public final class GrapheneProxy extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GrapheneProxy.ConstantFutureTarget |
static interface |
GrapheneProxy.FutureTarget
Interface for computation of future target of invocation by proxy.
|
Constructor and Description |
---|
GrapheneProxy() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
getProxyForFutureTarget(GrapheneContext context,
GrapheneProxy.FutureTarget futureTarget,
Class<?> baseType,
Class<?>... additionalInterfaces)
Wraps the given future target instance in the proxy.
|
static <T> T |
getProxyForHandler(GrapheneProxyHandler handler,
Class<?> baseType,
Class<?>... additionalInterfaces) |
static <T> T |
getProxyForTarget(GrapheneContext context,
T target)
Wraps the given target instance in the proxy.
|
static <T> T |
getProxyForTargetWithInterfaces(GrapheneContext context,
T target,
Class<?>... interfaces)
Wraps the given target instance in the proxy.
|
static boolean |
isProxyInstance(Object target)
Returns whether given
object is instance of context proxy. |
public static boolean isProxyInstance(Object target)
object
is instance of context proxy.target
- target instance to checkpublic 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.
target
- the target instance to be wrappedpublic 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.
target
- the target instance to be wrappedinterfaces
- the list of interfaces which should be implemented by created proxypublic 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.
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 implementpublic static <T> T getProxyForHandler(GrapheneProxyHandler handler, Class<?> baseType, Class<?>... additionalInterfaces)
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.