Package org.jclouds.rest.internal
Class DelegatesToInvocationFunction<S,F extends com.google.common.base.Function<Invocation,Object>>
- java.lang.Object
-
- org.jclouds.rest.internal.DelegatesToInvocationFunction<S,F>
-
- Type Parameters:
S- The enclosing type of the interface that a dynamic proxy like this implementsF- The function that implements this dynamic proxy
- All Implemented Interfaces:
InvocationHandler
@Beta public class DelegatesToInvocationFunction<S,F extends com.google.common.base.Function<Invocation,Object>> extends Object implements InvocationHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.inject.Injectorinjectorprotected FmethodInvokerprotected com.google.common.base.Function<InvocationSuccess,com.google.common.base.Optional<Object>>optionalConverterprotected com.google.common.reflect.TypeToken<S>ownerTypeprotected SetCallersetCaller
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Objecthandle(Invocation invocation)Objectinvoke(Object proxy, Method invoked, Object[] argv)protected com.google.inject.Key<?>methodInvokerFor(Class<?> returnType)attempts to guess the generic type params for the delegate's invocation function based on the supplied typeStringtoString()
-
-
-
Field Detail
-
injector
protected final com.google.inject.Injector injector
-
ownerType
protected final com.google.common.reflect.TypeToken<S> ownerType
-
setCaller
protected final SetCaller setCaller
-
optionalConverter
protected final com.google.common.base.Function<InvocationSuccess,com.google.common.base.Optional<Object>> optionalConverter
-
methodInvoker
protected final F extends com.google.common.base.Function<Invocation,Object> methodInvoker
-
-
Method Detail
-
invoke
public final Object invoke(Object proxy, Method invoked, @Nullable Object[] argv) throws Throwable
proxy.hashCode()delegates toAbstractInvocationHandler#hashCodeproxy.toString()delegates toAbstractInvocationHandler#toStringproxy.equals(argument)returns true if:proxyandargumentare of the same type- and
AbstractInvocationHandler#equalsreturns true for theInvocationHandlerofargument
- other method calls are dispatched to
#handleInvocation.
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
handle
protected Object handle(Invocation invocation)
-
methodInvokerFor
protected com.google.inject.Key<?> methodInvokerFor(Class<?> returnType)
attempts to guess the generic type params for the delegate's invocation function based on the supplied type
-
-