Class GrapheneProxy
java.lang.Object
org.jboss.arquillian.graphene.proxy.GrapheneProxy
GrapheneProxy provides methods for wrapping the target of invocation in the proxy.
- Author:
- Lukas Fryc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfaceInterface for computation of future target of invocation by proxy. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetProxyForFutureTarget(GrapheneContext context, GrapheneProxy.FutureTarget futureTarget, Class<?> baseType, Class<?>... additionalInterfaces) Wraps the given future target instance in the proxy.static <T> TgetProxyForHandler(GrapheneProxyHandler handler, Class<?> baseType, Class<?>... additionalInterfaces) static <T> TgetProxyForTarget(GrapheneContext context, T target) Wraps the given target instance in the proxy.static <T> TgetProxyForTargetWithInterfaces(GrapheneContext context, T target, Class<?>... interfaces) Wraps the given target instance in the proxy.static booleanisProxyInstance(Object target) Returns whether givenobjectis instance of context proxy.
-
Constructor Details
-
GrapheneProxy
public GrapheneProxy()
-
-
Method Details
-
isProxyInstance
Returns whether givenobjectis instance of context proxy.- Parameters:
target- target instance to check- Returns:
- true when target is a Proxy instance, false otherwise
-
getProxyForTarget
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 wrappedinterfaces- 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 invocationbaseType- the list of classes from which should be determined what interfaces will returned proxy implementadditionalInterfaces- 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)
-