From 13fa341a0e0d3d915ffa82fab4ff4dc8c070e6c0 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 21 Jul 2010 15:25:22 -0700 Subject: [PATCH] fixed conflict where multiple classes with the same method name and args tripped over themselves. enhanced trace logging and authz exception --- .../org/jclouds/internal/ClassMethodArgs.java | 6 + .../jclouds/rest/AuthorizationException.java | 4 + .../org/jclouds/rest/RestContextFactory.java | 265 +++++++++++------- .../rest/internal/AsyncRestClientProxy.java | 48 ++-- .../internal/RestAnnotationProcessor.java | 21 +- 5 files changed, 213 insertions(+), 131 deletions(-) diff --git a/core/src/main/java/org/jclouds/internal/ClassMethodArgs.java b/core/src/main/java/org/jclouds/internal/ClassMethodArgs.java index 0ab29db12c..c76702b8e3 100644 --- a/core/src/main/java/org/jclouds/internal/ClassMethodArgs.java +++ b/core/src/main/java/org/jclouds/internal/ClassMethodArgs.java @@ -40,6 +40,12 @@ public class ClassMethodArgs { this.args = args; } + @Override + public String toString() { + return "[class=" + asyncClass.getSimpleName() + ", method=" + method.getName() + ", args=" + + Arrays.toString(args) + "]"; + } + public Method getMethod() { return method; } diff --git a/core/src/main/java/org/jclouds/rest/AuthorizationException.java b/core/src/main/java/org/jclouds/rest/AuthorizationException.java index d919a5dd46..c13f05a73a 100644 --- a/core/src/main/java/org/jclouds/rest/AuthorizationException.java +++ b/core/src/main/java/org/jclouds/rest/AuthorizationException.java @@ -42,6 +42,10 @@ public class AuthorizationException extends RuntimeException { super(String.format("%s -> %s", resource.getRequestLine(), error)); } + public AuthorizationException(HttpRequest resource, String error, Throwable arg1) { + super(String.format("%s -> %s", resource.getRequestLine(), error), arg1); + } + public AuthorizationException(Throwable arg0) { super(arg0); } diff --git a/core/src/main/java/org/jclouds/rest/RestContextFactory.java b/core/src/main/java/org/jclouds/rest/RestContextFactory.java index 3509934815..65183dc5b7 100644 --- a/core/src/main/java/org/jclouds/rest/RestContextFactory.java +++ b/core/src/main/java/org/jclouds/rest/RestContextFactory.java @@ -39,7 +39,8 @@ import com.google.common.collect.ImmutableSet; import com.google.inject.Module; /** - * Helper class to instantiate {@code RestContext} instances. "blobstore.properties" + * Helper class to instantiate {@code RestContext} instances. + * "blobstore.properties" * * At least one property is needed needed per context: *