Package jadex.bytecode
Class ProxyFactory
java.lang.Object
jadex.bytecode.ProxyFactory
Create a proxy with standard Java or per Jadex ASM.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InvocationHandler
getInvocationHandler
(Object proxy) Get the invocation handler of a proxy.static boolean
isASMProxyClass
(Class<?> cl) Test if it is a ASM proxy class.static boolean
isProxyClass
(Class<?> cl) Returns true if and only if the specified class was dynamically generated to be a proxy class using thegetProxyClass
method or thenewProxyInstance
method.static Object
newProxyInstance
(ClassLoader loader, Class<?>[] interfaces, InvocationHandler h) Returns an instance of a proxy class for the specified interfaces that dispatches method invocations to the specified invocation handler.
-
Field Details
-
useasm
public static boolean useasm
-
-
Constructor Details
-
ProxyFactory
public ProxyFactory()
-
-
Method Details
-
newProxyInstance
public static Object newProxyInstance(ClassLoader loader, Class<?>[] interfaces, InvocationHandler h) Returns an instance of a proxy class for the specified interfaces that dispatches method invocations to the specified invocation handler. -
getInvocationHandler
Get the invocation handler of a proxy.- Parameters:
proxy
-- Returns:
- The handler
- Throws:
IllegalArgumentException
-
isProxyClass
Returns true if and only if the specified class was dynamically generated to be a proxy class using thegetProxyClass
method or thenewProxyInstance
method.The reliability of this method is important for the ability to use it to make security decisions, so its implementation should not just test if the class in question extends
Proxy
.- Parameters:
cl
- the class to test- Returns:
true
if the class is a proxy class andfalse
otherwise- Throws:
NullPointerException
- ifcl
isnull
-
isASMProxyClass
Test if it is a ASM proxy class.- Parameters:
cl
- The class.- Returns:
- True, if is asm proxy class.
-