public class ComponentImpl extends java.lang.Object implements Component, ContextAware, NameAware, java.lang.reflect.InvocationHandler
Component myComponent = tideContext.set("myComponent", new ComponentImpl(serverSession));
myComponent.call("myMethod", arg1, arg2);
| Constructor and Description |
|---|
ComponentImpl()
Default constructor necessary for testing and CDI proxying...
|
ComponentImpl(ServerSession serverSession)
Create a new proxy attached to the specified server session
|
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.concurrent.Future<T> |
call(java.lang.String operation,
java.lang.Object... args)
Call a remote operation on the component
|
protected <T> java.util.concurrent.Future<T> |
callComponent(Context context,
java.lang.String operation,
java.lang.Object[] args)
Calls a remote component
|
protected Context |
getContext()
Context where the component is set
|
java.lang.String |
getName()
Remote name of the component
|
protected ServerSession |
getServerSession()
Server session to which the component is attached
|
protected <T> java.util.concurrent.Future<T> |
invoke(Context context,
java.lang.String operation,
java.lang.Object[] args,
TideResponder<T> tideResponder)
Execute the invocation of the remote component
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
<T> TideResultEvent<T> |
newResultEvent(T result)
Create a result event for this component
|
void |
setContext(Context context)
Set the context where the component is set
|
void |
setName(java.lang.String name)
Set the remote name of the component
By default the component will use its name in its owning context as the remote name
|
public ComponentImpl()
public ComponentImpl(ServerSession serverSession)
serverSession - server sessionpublic void setName(java.lang.String name)
public java.lang.String getName()
public void setContext(Context context)
setContext in interface ContextAwarecontext - Tide contextprotected Context getContext()
protected ServerSession getServerSession()
public <T> java.util.concurrent.Future<T> call(java.lang.String operation,
java.lang.Object... args)
Componentpublic java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
invoke in interface java.lang.reflect.InvocationHandlerjava.lang.Throwableprotected <T> java.util.concurrent.Future<T> callComponent(Context context, java.lang.String operation, java.lang.Object[] args)
context - the source contextoperation - name of the called methoargs - method argumentsprotected <T> java.util.concurrent.Future<T> invoke(Context context, java.lang.String operation, java.lang.Object[] args, TideResponder<T> tideResponder)
T - expected type of resultcontext - the source contextoperation - method nameargs - method argumentstideResponder - Tide responder for the remote callpublic <T> TideResultEvent<T> newResultEvent(T result)
T - expected type of the resultresult - result to wrap in an event