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 InvocationHandlergetInvocationHandler(Object proxy) Get the invocation handler of a proxy.static booleanisASMProxyClass(Class<?> cl) Test if it is a ASM proxy class.static booleanisProxyClass(Class<?> cl) Returns true if and only if the specified class was dynamically generated to be a proxy class using thegetProxyClassmethod or thenewProxyInstancemethod.static ObjectnewProxyInstance(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 thegetProxyClassmethod or thenewProxyInstancemethod.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:
trueif the class is a proxy class andfalseotherwise- Throws:
NullPointerException- ifclisnull
-
isASMProxyClass
Test if it is a ASM proxy class.- Parameters:
cl- The class.- Returns:
- True, if is asm proxy class.
-