@Singleton public class AsyncRestClientProxy<T> extends Object implements InvocationHandler
Provides annotation, it responds via a Injector lookupDelegate annotation, it responds with an instance of interface
set in returnVal, adding the current JAXrs annotations to whatever are on that class.Delegate has a Path annotation, and the returnval
interface also has Path, these values are combined.RestAnnotationProcessor.delegationMap contains a mapping for this, and the
returnVal is properly assigned as a ListenableFuture, it responds with an http
implementation.method is intended
solely to set constants| Modifier and Type | Class and Description |
|---|---|
static interface |
AsyncRestClientProxy.Factory |
| Modifier and Type | Field and Description |
|---|---|
protected Logger |
logger |
protected long |
requestTimeoutMilliseconds
maximum duration of an unwrapped http Request
|
| Constructor and Description |
|---|
AsyncRestClientProxy(com.google.inject.Injector injector,
AsyncRestClientProxy.Factory factory,
RestAnnotationProcessor<T> util,
com.google.inject.TypeLiteral<T> typeLiteral,
com.google.common.cache.LoadingCache<ClassMethodArgs,Object> delegateMap) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
Object |
invoke(Object o,
Method method,
Object[] args) |
boolean |
isRestCall(Method method) |
Object |
lookupValueFromGuice(Method method) |
Object |
propagateContextToDelegate(Method method,
Object[] args) |
String |
toString() |
@Inject(optional=true) @Named(value="jclouds.request-timeout") protected long requestTimeoutMilliseconds
protected Logger logger
@Inject
public AsyncRestClientProxy(com.google.inject.Injector injector,
AsyncRestClientProxy.Factory factory,
RestAnnotationProcessor<T> util,
com.google.inject.TypeLiteral<T> typeLiteral,
@Named(value="async")
com.google.common.cache.LoadingCache<ClassMethodArgs,Object> delegateMap)
public Object invoke(Object o, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowablepublic boolean isRestCall(Method method)
public Object propagateContextToDelegate(Method method, Object[] args) throws ExecutionException
ExecutionExceptionCopyright © 2009-2012 jclouds. All Rights Reserved.