T - Type of the wrapped classpublic class DelegatingProxyFactory<T> extends Object implements InvocationHandler, Delegating<T>
Proxy class.
This class is used to do lightweight AOP.| Constructor and Description |
|---|
DelegatingProxyFactory(T delegate)
Main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
getDelegate()
Return Wrapped class and concrete implementation.
|
protected Object |
invoke(DelegatingMethodInvocation<T> delegatingMethodInvocation)
Method to override in child classes.
|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
Object |
newProxy(Class<?>... interfaces)
Create a proxy using given classloader and interfaces.
|
<X> X |
newProxy(Class<X> interfaces)
Create a proxy using given classloader and interfaces.
|
Object |
newProxy(ClassLoader classLoader,
Class<?>... interfaces)
Create a proxy using given classloader and interfaces
|
public DelegatingProxyFactory(T delegate)
delegate - Wrapped class and concrete implementationpublic final Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowableprotected Object invoke(DelegatingMethodInvocation<T> delegatingMethodInvocation) throws Throwable
delegatingMethodInvocation - Method invocation (arguments, method name, etc.)Throwable - Method invocation raised exceptionpublic T getDelegate()
getDelegate in interface Delegating<T>public Object newProxy(ClassLoader classLoader, Class<?>... interfaces)
classLoader - Class loaderinterfaces - Interfaces to implementpublic Object newProxy(Class<?>... interfaces)
interfaces - Interfaces to implementCopyright © 2019. All rights reserved.