public abstract class GrapheneProxyHandler extends Object implements net.sf.cglib.proxy.MethodInterceptor, InvocationHandler
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.
Constructor and Description |
---|
GrapheneProxyHandler(GrapheneProxy.FutureTarget future)
Returns invocation handler which wraps the target for future computation.
|
GrapheneProxyHandler(Object target)
Returns invocation handler which wraps the given target instance.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
getTarget()
Computes the target for invocation - if future target is provided, it will be returned, othewise the target instance will
be returned.
|
Object |
intercept(Object obj,
Method method,
Object[] args,
net.sf.cglib.proxy.MethodProxy proxy)
Delegates to
invoke(Object, Method, Object[]) to serve as MethodInterceptor . |
abstract Object |
invoke(Object proxy,
Method method,
Object[] args)
End point for handling invocations on proxy.
|
protected Object |
invokeReal(Object target,
Method method,
Object[] args)
Invokes the method on real target.
|
protected boolean |
isProxyable(Method method,
Object[] args)
Determines whenever the given invocation can be proxied.
|
public GrapheneProxyHandler(Object target)
target
- the target of invocationpublic GrapheneProxyHandler(GrapheneProxy.FutureTarget future)
future
- the future targetpublic abstract 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
GrapheneProxyHandler
wrapping the result of invocation.
The method specifically handles GrapheneProxyInstance.unwrap()
method which returns the real target for
invocation.
invoke
in interface InvocationHandler
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
Throwable
protected boolean isProxyable(Method method, Object[] args)
method
- the method which is invokedargs
- the arguments used for invocationprotected Object invokeReal(Object target, Method method, Object[] args) throws Throwable
Invokes the method on real target.
target
- the target to be invokedmethod
- the method to be invokedargs
- the arguments used for invocationThrowable
protected Object getTarget()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.