public class DefaultInvocationHandler extends Object implements InvocationHandler
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()
protected List<Class<?>> getImplementedInterfacesOf(Class<?> type, Class<?>... types)
types
. The default
implementation caches the results.public Class<?> getProxyClass(Class<?>... interfaces) throws IllegalArgumentException
interfaces
- The interface Class
es the
Proxy
Class
will implement.Proxy
.IllegalArgumentException
public 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).public Object newProxyInstance(Class<?>... interfaces) throws IllegalArgumentException
Proxy.newProxyInstance(ClassLoader,Class[],InvocationHandler)
.
Default implementation invokes getProxyClass(Class...)
.interfaces
- The interface Class
es the
Proxy
Class
will implement.Proxy
.IllegalArgumentException
Copyright © 2015–2020. All rights reserved.