public class GrapheneContextualHandler extends GrapheneProxyHandler
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.
Modifier and Type | Method and Description |
---|---|
static GrapheneContextualHandler |
forFuture(GrapheneContext context,
GrapheneProxy.FutureTarget future)
Returns invocation handler which wraps the target for future computation.
|
static GrapheneContextualHandler |
forTarget(GrapheneContext context,
Object target)
Returns invocation handler which wraps the given target instance.
|
Object |
intercept(Object obj,
Method method,
Object[] args,
net.sf.cglib.proxy.MethodProxy proxy)
Delegates to
invoke(Object, Method, Object[]) to serve as MethodInterceptor . |
Object |
invoke(Object proxy,
Method method,
Object[] args)
End point for handling invocations on proxy.
|
void |
resetInterceptors()
Resets the interceptors
|
getTarget, invokeReal, isProxyable
public static GrapheneContextualHandler forTarget(GrapheneContext context, Object target)
target
- the target of invocationpublic static GrapheneContextualHandler forFuture(GrapheneContext context, GrapheneProxy.FutureTarget future)
future
- the future targetpublic Object invoke(Object proxy, Method method, Object[] args) throws Throwable
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
GrapheneContextualHandler
wrapping the result of invocation.
The method specifically handles GrapheneProxyInstance.unwrap()
method which returns the real target for
invocation.
invoke
in interface InvocationHandler
invoke
in class GrapheneProxyHandler
Throwable
public Object intercept(Object obj, Method method, Object[] args, net.sf.cglib.proxy.MethodProxy proxy) throws Throwable
invoke(Object, Method, Object[])
to serve as MethodInterceptor
.intercept
in interface net.sf.cglib.proxy.MethodInterceptor
intercept
in class GrapheneProxyHandler
Throwable
public void resetInterceptors()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.