public class DefaultInvocationHandler extends Object implements DefaultInterfaceMethodInvocationHandler
InvocationHandler implementation.
See invoke(Object,Method,Object[]).| Constructor and Description |
|---|
DefaultInvocationHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected List<Class<?>> |
getImplementedInterfacesOf(Class<?> type,
Class<?>... types)
Method available to subclass implementations to get the implemented
interfaces of the argument
types. |
Class<?> |
getProxyClass(Class<?>... interfaces)
|
Object |
invoke(Object proxy,
Method method,
Object[] argv)
If the
method.isDefault(), that
Method will be invoked directly. |
Object |
newProxyInstance(Class<?>... interfaces)
|
public DefaultInvocationHandler()
public Class<?> getProxyClass(Class<?>... interfaces) throws IllegalArgumentException
interfaces - The interface Classes the
Proxy Class will implement.Proxy.IllegalArgumentExceptionpublic Object newProxyInstance(Class<?>... interfaces) throws IllegalArgumentException
Proxy.newProxyInstance(ClassLoader,Class[],InvocationHandler).
Default implementation invokes getProxyClass(Class...).interfaces - The interface Classes the
Proxy Class will implement.Proxy.IllegalArgumentExceptionpublic Object invoke(Object proxy, Method method, Object[] argv) throws Throwable
method.isDefault(), that
Method will be invoked directly. If the Method is
declared in Object, it is applied to this
InvocationHandler. Otherwise, the call will be dispatched to
a declared Method on this InvocationHandler
with the same name and compatible parameter types (forcing access if
necessary).invoke in interface DefaultInterfaceMethodInvocationHandlerinvoke in interface InvocationHandlerproxy - The proxy instance.method - The Method.argv - The argument array.Method invocation.Exception - If no compatible Method is found or
the Method cannot be invoked.ThrowableCopyright © 2015–2021. All rights reserved.