Class ProxyFactory

java.lang.Object
jadex.bytecode.ProxyFactory

public class ProxyFactory extends Object
Create a proxy with standard Java or per Jadex ASM.
  • 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

      public static InvocationHandler getInvocationHandler(Object proxy) throws IllegalArgumentException
      Get the invocation handler of a proxy.
      Parameters:
      proxy -
      Returns:
      The handler
      Throws:
      IllegalArgumentException
    • isProxyClass

      public static boolean isProxyClass(Class<?> cl)
      Returns true if and only if the specified class was dynamically generated to be a proxy class using the getProxyClass method or the newProxyInstance 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 and false otherwise
      Throws:
      NullPointerException - if cl is null
    • isASMProxyClass

      public static boolean isASMProxyClass(Class<?> cl)
      Test if it is a ASM proxy class.
      Parameters:
      cl - The class.
      Returns:
      True, if is asm proxy class.