public class AbstractInvocationHandler<Z,D extends Database<Z>,T,E extends Exception,F extends ProxyFactory<Z,D,T,E>> extends Object implements InvocationHandler<Z,D,T,E,F>
Modifier | Constructor and Description |
---|---|
protected |
AbstractInvocationHandler(Class<T> targetClass,
F proxyFactory) |
Modifier and Type | Method and Description |
---|---|
protected InvocationStrategy |
getInvocationStrategy(T object,
Method method,
Object... parameters)
Returns the appropriate
InvocationStrategy for the specified method. |
protected <R,X> Invoker<Z,D,T,R,E> |
getInvoker(Class<X> parameterClass,
int parameterIndex,
T proxy,
Method method,
Object... parameters) |
protected <R> Invoker<Z,D,T,R,E> |
getInvoker(T proxy,
Method method,
Object... parameters)
Return the appropriate invoker for the specified method.
|
F |
getProxyFactory() |
protected ProxyFactoryFactory<Z,D,T,E,?,? extends Exception> |
getProxyFactoryFactory(T object,
Method method,
Object... parameters) |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
protected <R> void |
postInvoke(Invoker<Z,D,T,R,E> invoker,
T proxy,
Method method,
Object... parameters) |
protected AbstractInvocationHandler(Class<T> targetClass, F proxyFactory)
public F getProxyFactory()
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
protected ProxyFactoryFactory<Z,D,T,E,?,? extends Exception> getProxyFactoryFactory(T object, Method method, Object... parameters) throws E extends Exception
protected InvocationStrategy getInvocationStrategy(T object, Method method, Object... parameters) throws E extends Exception
InvocationStrategy
for the specified method.
This implementation detects Wrapper
methods; and Object.equals(java.lang.Object)
, Object.hashCode()
, and Object.toString()
.
Default invocation strategy is AllResultsCollector
.protected <R> Invoker<Z,D,T,R,E> getInvoker(T proxy, Method method, Object... parameters) throws E extends Exception
proxy
- method
- parameters
- Exception
protected <R,X> Invoker<Z,D,T,R,E> getInvoker(Class<X> parameterClass, int parameterIndex, T proxy, Method method, Object... parameters) throws E extends Exception
Copyright © 2004–2014 Paul Ferraro. All rights reserved.