| java.lang.Object java.lang.reflect.Proxy
Method Summary | |
public static InvocationHandler | getInvocationHandler(Object proxy) Return the proxy instance's invocation handler.
Parameters: proxy - the proxy instance. | public static Class> | getProxyClass(ClassLoader loader, Class>[] interfaces) Return the dynamically build class for the given interfaces, build a new
one when necessary. | public static boolean | isProxyClass(Class> cl) Return whether the supplied class is a dynamically generated proxy class.
Parameters: cl - the class. | public static Object | newProxyInstance(ClassLoader loader, Class>[] interfaces, InvocationHandler h) Return an instance of the dynamically build class for the given
interfaces that forwards methods to the specified invocation handler.
The interfaces must be visible from the supplied class loader; no
duplicates are permitted. |
getProxyClass | public static Class> getProxyClass(ClassLoader loader, Class>[] interfaces) throws IllegalArgumentException(Code) | | Return the dynamically build class for the given interfaces, build a new
one when necessary. The order of the interfaces is important.
The interfaces must be visible from the supplied class loader; no
duplicates are permitted. All non-public interfaces must be defined in
the same package.
Parameters: loader - the class loader that will define the proxy class. Parameters: interfaces - an array of Class objects, each one identifyingan interface that the new proxy must implement a proxy class that implements all of the interfaces referred toin the contents of interfaces . exception: IllegalArgumentException - exception: NullPointerException - if either interfaces or any of its elementsare null . |
isProxyClass | public static boolean isProxyClass(Class> cl)(Code) | | Return whether the supplied class is a dynamically generated proxy class.
Parameters: cl - the class. true if the class is a proxy class and false otherwise. exception: NullPointerException - if the class is null. |
newProxyInstance | public static Object newProxyInstance(ClassLoader loader, Class>[] interfaces, InvocationHandler h) throws IllegalArgumentException(Code) | | Return an instance of the dynamically build class for the given
interfaces that forwards methods to the specified invocation handler.
The interfaces must be visible from the supplied class loader; no
duplicates are permitted. All non-public interfaces must be defined in
the same package.
Parameters: loader - the class loader that will define the proxy class. Parameters: interfaces - the list of interfaces to implement. Parameters: h - the invocation handler for the forwarded methods. a new proxy object that delegates to the handler h exception: IllegalArgumentException - exception: NullPointerException - if the interfaces or any of its elements are null. |
|
|