org.granite.client.tide.impl
Class ComponentImpl

java.lang.Object
  extended by org.granite.client.tide.impl.ComponentImpl
All Implemented Interfaces:
InvocationHandler, ContextAware, NameAware, Component
Direct Known Subclasses:
BaseIdentity

public class ComponentImpl
extends Object
implements Component, ContextAware, NameAware, InvocationHandler

Author:
William DRAI

Constructor Summary
ComponentImpl()
           
ComponentImpl(ServerSession serverSession)
           
 
Method Summary
<T> Future<T>
call(String operation, Object... args)
           
protected
<T> Future<T>
callComponent(Context context, String operation, Object[] args, boolean withContext)
          Calls a remote component
protected  Context getContext()
           
 String getName()
           
protected  ServerSession getServerSession()
           
<T> Future<T>
invoke(Context context, Component component, String operation, Object[] args, TideResponder<T> tideResponder, boolean withContext, ComponentListener.Handler<T> handler)
           
 Object invoke(Object proxy, Method method, Object[] args)
           
 void setContext(Context context)
           
 void setName(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentImpl

public ComponentImpl()

ComponentImpl

public ComponentImpl(ServerSession serverSession)
Method Detail

setName

public void setName(String name)
Specified by:
setName in interface NameAware

getName

public String getName()
Specified by:
getName in interface Component

setContext

public void setContext(Context context)
Specified by:
setContext in interface ContextAware

getContext

protected Context getContext()

getServerSession

protected ServerSession getServerSession()

call

public <T> Future<T> call(String operation,
                          Object... args)
Specified by:
call in interface Component

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

callComponent

protected <T> Future<T> callComponent(Context context,
                                      String operation,
                                      Object[] args,
                                      boolean withContext)
Calls a remote component

Parameters:
component - the target component
op - name of the called metho
arg - method parameters
withContext - add context sync data to call
Returns:
the operation token

invoke

public <T> Future<T> invoke(Context context,
                            Component component,
                            String operation,
                            Object[] args,
                            TideResponder<T> tideResponder,
                            boolean withContext,
                            ComponentListener.Handler<T> handler)