Class GrapheneProxy

java.lang.Object
org.jboss.arquillian.graphene.proxy.GrapheneProxy

public final class GrapheneProxy extends Object
GrapheneProxy provides methods for wrapping the target of invocation in the proxy.
Author:
Lukas Fryc
  • Constructor Details

    • GrapheneProxy

      public GrapheneProxy()
  • Method Details

    • isProxyInstance

      public static boolean isProxyInstance(Object target)
      Returns whether given object is instance of context proxy.
      Parameters:
      target - target instance to check
      Returns:
      true when target is a Proxy instance, false otherwise
    • getProxyForTarget

      public static <T> T getProxyForTarget(GrapheneContext context, T target)

      Wraps the given target instance in the proxy.

      The list of interfaces which should be implemented by the proxy is automatically computer from provided instance.

      Parameters:
      target - the target instance to be wrapped
      Returns:
      the proxy wrapping the target
    • getProxyForTargetWithInterfaces

      public static <T> T getProxyForTargetWithInterfaces(GrapheneContext context, T target, Class<?>... interfaces)

      Wraps the given target instance in the proxy.

      The list of interfaces which should be implemented by the proxy needs to be provided.

      Parameters:
      target - the target instance to be wrapped
      interfaces - the list of interfaces which should be implemented by created proxy
      Returns:
      the proxy wrapping the target
    • getProxyForFutureTarget

      public static <T> T getProxyForFutureTarget(GrapheneContext context, GrapheneProxy.FutureTarget futureTarget, Class<?> baseType, Class<?>... additionalInterfaces)

      Wraps the given future target instance in the proxy.

      Future target can be computed dynamically for each invocation of proxy.

      In this case interfaces which should the proxy implement needs to be provided.

      The list of any classes can be provided, the list of interfaces will be automatically computed.

      Parameters:
      futureTarget - the future target of invocation
      baseType - the list of classes from which should be determined what interfaces will returned proxy implement
      additionalInterfaces - additional interfaces which should a created proxy implement
      Returns:
      the proxy wrapping the future target
    • getProxyForHandler

      public static <T> T getProxyForHandler(GrapheneProxyHandler handler, Class<?> baseType, Class<?>... additionalInterfaces)