public abstract class DynamicProxySupport<RequiredInterfaceType> extends Object implements InvocationHandler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected RequiredInterfaceType |
delegate |
protected Map<String,Method> |
proxiedMethods |
| Modifier | Constructor and Description |
|---|---|
protected |
DynamicProxySupport(RequiredInterfaceType delegate) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addIfNotNull(Deque<ClassLoader> classLoaders,
ClassLoader cl) |
protected Object |
callNativeMethod(Method method,
Object... args)
Delegates the call to the native method in the delegate.
|
RequiredInterfaceType |
createDynamicProxy() |
protected Deque<ClassLoader> |
getClassLoadersToTry() |
protected Class<?>[] |
getInterfaceClasses() |
protected abstract Class<RequiredInterfaceType> |
getRequiredInterfaceType() |
protected abstract void |
handleInvocationException(Throwable e)
Down-call to handle exceptions after an invocation.
|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
static boolean |
isProxyInstanceOfClass(Class<?> clazz,
Object o) |
void |
markClosed() |
protected abstract void |
throwInvocationAfterClose(String method) |
protected boolean closed
protected final RequiredInterfaceType delegate
protected DynamicProxySupport(RequiredInterfaceType delegate)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowableprotected abstract void handleInvocationException(Throwable e) throws Throwable
e - Throwableprotected abstract void throwInvocationAfterClose(String method) throws Exception
Exceptionprotected Object callNativeMethod(Method method, Object... args) throws Throwable
method - args - Throwablepublic RequiredInterfaceType createDynamicProxy()
protected Deque<ClassLoader> getClassLoadersToTry()
protected void addIfNotNull(Deque<ClassLoader> classLoaders, ClassLoader cl)
protected abstract Class<RequiredInterfaceType> getRequiredInterfaceType()
public void markClosed()
protected Class<?>[] getInterfaceClasses()
Copyright © 2023. All rights reserved.