org.granite.gravity
Class GravityProxy

java.lang.Object
  extended by org.granite.gravity.GravityProxy
All Implemented Interfaces:
ShutdownListener, Gravity

public class GravityProxy
extends Object
implements Gravity

Author:
William DRAI

Field Summary
 
Fields inherited from interface org.granite.gravity.Gravity
BYTEARRAY_BODY_HEADER, ENCODE_MESSAGE_BODY_KEY, RECONNECT_INTERVAL_MS_KEY, RECONNECT_MAX_ATTEMPTS_KEY
 
Constructor Summary
GravityProxy()
           
GravityProxy(ServletContext servletContext)
           
 
Method Summary
 boolean access(String channelId)
           
 boolean cancel(AsyncChannelRunner runnable)
           
 void execute(AsyncChannelRunner runnable)
           
<C extends Channel>
C
getChannel(ChannelFactory<C> channelFactory, String channelId)
           
 GraniteConfig getGraniteConfig()
           
protected  Gravity getGravity()
           
 GravityConfig getGravityConfig()
           
 ServiceAdapter getServiceAdapter(String messageType, String destinationId)
           
 ServicesConfig getServicesConfig()
           
 SharedContext getSharedContext()
           
 UdpReceiverFactory getUdpReceiverFactory()
           
 Message handleMessage(ChannelFactory<?> channelFactory, Message message)
           
 Message handleMessage(ChannelFactory<?> channelFactory, Message message, boolean skipInterceptor)
           
 boolean hasUdpReceiverFactory()
           
 GraniteContext initThread(String sessionId, String clientType)
           
 boolean isStarted()
           
 Message publishMessage(AsyncMessage message)
           
 Message publishMessage(Channel fromChannel, AsyncMessage message)
           
 void reconfigure(GravityConfig gravityConfig, GraniteConfig graniteConfig)
           
 void releaseThread()
           
 Channel removeChannel(String channelId, boolean timeout)
           
 void start()
           
 void stop()
           
 void stop(boolean now)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GravityProxy

public GravityProxy()

GravityProxy

public GravityProxy(ServletContext servletContext)
Method Detail

getGravity

protected Gravity getGravity()

getGravityConfig

public GravityConfig getGravityConfig()
Specified by:
getGravityConfig in interface Gravity

getServicesConfig

public ServicesConfig getServicesConfig()
Specified by:
getServicesConfig in interface Gravity

getGraniteConfig

public GraniteConfig getGraniteConfig()
Specified by:
getGraniteConfig in interface Gravity

getSharedContext

public SharedContext getSharedContext()
Specified by:
getSharedContext in interface Gravity

isStarted

public boolean isStarted()
Specified by:
isStarted in interface Gravity

initThread

public GraniteContext initThread(String sessionId,
                                 String clientType)
Specified by:
initThread in interface Gravity

releaseThread

public void releaseThread()
Specified by:
releaseThread in interface Gravity

getServiceAdapter

public ServiceAdapter getServiceAdapter(String messageType,
                                        String destinationId)
Specified by:
getServiceAdapter in interface Gravity

hasUdpReceiverFactory

public boolean hasUdpReceiverFactory()
Specified by:
hasUdpReceiverFactory in interface Gravity

getUdpReceiverFactory

public UdpReceiverFactory getUdpReceiverFactory()
Specified by:
getUdpReceiverFactory in interface Gravity

start

public void start()
           throws Exception
Specified by:
start in interface Gravity
Throws:
Exception

reconfigure

public void reconfigure(GravityConfig gravityConfig,
                        GraniteConfig graniteConfig)
Specified by:
reconfigure in interface Gravity

stop

public void stop()
          throws Exception
Specified by:
stop in interface ShutdownListener
Specified by:
stop in interface Gravity
Throws:
Exception

stop

public void stop(boolean now)
          throws Exception
Specified by:
stop in interface Gravity
Throws:
Exception

getChannel

public <C extends Channel> C getChannel(ChannelFactory<C> channelFactory,
                                        String channelId)
Specified by:
getChannel in interface Gravity

removeChannel

public Channel removeChannel(String channelId,
                             boolean timeout)
Specified by:
removeChannel in interface Gravity

access

public boolean access(String channelId)
Specified by:
access in interface Gravity

execute

public void execute(AsyncChannelRunner runnable)
Specified by:
execute in interface Gravity

cancel

public boolean cancel(AsyncChannelRunner runnable)
Specified by:
cancel in interface Gravity

handleMessage

public Message handleMessage(ChannelFactory<?> channelFactory,
                             Message message)
Specified by:
handleMessage in interface Gravity

handleMessage

public Message handleMessage(ChannelFactory<?> channelFactory,
                             Message message,
                             boolean skipInterceptor)
Specified by:
handleMessage in interface Gravity

publishMessage

public Message publishMessage(AsyncMessage message)
Specified by:
publishMessage in interface Gravity

publishMessage

public Message publishMessage(Channel fromChannel,
                              AsyncMessage message)
Specified by:
publishMessage in interface Gravity