Class GrapheneContextualHandler
java.lang.Object
org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler
org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler
- All Implemented Interfaces:
InvocationHandler,MethodInterceptor
Invocation handler which wraps the given target for invocation (as the target instance for future computation of target).
This handlers determines whenever the result of invocation can be proxied and if yes, it recursively wraps it with proxy using this invocation handler.
- Author:
- Lukas Fryc
-
Method Summary
Modifier and TypeMethodDescriptionstatic GrapheneContextualHandlerforFuture(GrapheneContext context, GrapheneProxy.FutureTarget future) Returns invocation handler which wraps the target for future computation.static GrapheneContextualHandlerforTarget(GrapheneContext context, Object target) Returns invocation handler which wraps the given target instance.static Objectintercept(Object self, MethodInterceptor interceptor, Method method, Object[] args) End point for handling invocations on proxy.voidResets the interceptorsMethods inherited from class org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler
getTarget, intercept, invokeReal, isProxyable
-
Method Details
-
forTarget
Returns invocation handler which wraps the given target instance.- Parameters:
target- the target of invocation- Returns:
- invocation handler which wraps the given target instance
-
intercept
@RuntimeType public static Object intercept(@This Object self, @FieldValue("__interceptor") MethodInterceptor interceptor, @Origin Method method, @AllArguments Object[] args) throws Throwable - Throws:
Throwable
-
forFuture
public static GrapheneContextualHandler forFuture(GrapheneContext context, GrapheneProxy.FutureTarget future) Returns invocation handler which wraps the target for future computation.- Parameters:
future- the future target- Returns:
- invocation handler which wraps the target for future computation
-
invoke
End point for handling invocations on proxy.
Decides whenever the result of invocation is proxyable and if yes, it returns the proxy using new instance of
GrapheneContextualHandlerwrapping the result of invocation.The method specifically handles
GrapheneProxyInstance.unwrap()method which returns the real target for invocation.- Specified by:
invokein interfaceInvocationHandler- Specified by:
invokein classGrapheneProxyHandler- Throws:
Throwable
-
resetInterceptors
public void resetInterceptors()Resets the interceptors
-