org.granite.gravity
Class DefaultGravity
java.lang.Object
org.granite.gravity.DefaultGravity
- All Implemented Interfaces:
- ShutdownListener, DefaultGravityMBean, Gravity
- Direct Known Subclasses:
- GAEGravity
public class DefaultGravity
- extends Object
- implements Gravity, DefaultGravityMBean
- Author:
- William DRAI, Franck WOLFF
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultGravity
public DefaultGravity(GravityConfig gravityConfig,
ServicesConfig servicesConfig,
GraniteConfig graniteConfig)
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
isStarted
public boolean isStarted()
- Specified by:
isStarted in interface DefaultGravityMBean- Specified by:
isStarted in interface Gravity
getServiceAdapter
public ServiceAdapter getServiceAdapter(String messageType,
String destinationId)
- Specified by:
getServiceAdapter in interface Gravity
start
public void start()
throws Exception
- Specified by:
start in interface DefaultGravityMBean- Specified by:
start in interface Gravity
- Throws:
Exception
internalStart
protected void internalStart()
restart
public void restart()
throws Exception
- Specified by:
restart in interface DefaultGravityMBean
- 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 DefaultGravityMBean- Specified by:
stop in interface Gravity
- Throws:
Exception
stop
public void stop(boolean now)
throws Exception
- Specified by:
stop in interface Gravity
- Throws:
Exception
getGravityFactoryName
public String getGravityFactoryName()
- Specified by:
getGravityFactoryName in interface DefaultGravityMBean
getChannelFactoryName
public String getChannelFactoryName()
- Specified by:
getChannelFactoryName in interface DefaultGravityMBean
getChannelIdleTimeoutMillis
public long getChannelIdleTimeoutMillis()
- Specified by:
getChannelIdleTimeoutMillis in interface DefaultGravityMBean
setChannelIdleTimeoutMillis
public void setChannelIdleTimeoutMillis(long channelIdleTimeoutMillis)
- Specified by:
setChannelIdleTimeoutMillis in interface DefaultGravityMBean
isRetryOnError
public boolean isRetryOnError()
- Specified by:
isRetryOnError in interface DefaultGravityMBean
setRetryOnError
public void setRetryOnError(boolean retryOnError)
- Specified by:
setRetryOnError in interface DefaultGravityMBean
getLongPollingTimeoutMillis
public long getLongPollingTimeoutMillis()
- Specified by:
getLongPollingTimeoutMillis in interface DefaultGravityMBean
setLongPollingTimeoutMillis
public void setLongPollingTimeoutMillis(long longPollingTimeoutMillis)
- Specified by:
setLongPollingTimeoutMillis in interface DefaultGravityMBean
getMaxMessagesQueuedPerChannel
public int getMaxMessagesQueuedPerChannel()
- Specified by:
getMaxMessagesQueuedPerChannel in interface DefaultGravityMBean
setMaxMessagesQueuedPerChannel
public void setMaxMessagesQueuedPerChannel(int maxMessagesQueuedPerChannel)
- Specified by:
setMaxMessagesQueuedPerChannel in interface DefaultGravityMBean
getReconnectIntervalMillis
public long getReconnectIntervalMillis()
- Specified by:
getReconnectIntervalMillis in interface DefaultGravityMBean
getReconnectMaxAttempts
public int getReconnectMaxAttempts()
- Specified by:
getReconnectMaxAttempts in interface DefaultGravityMBean
getCorePoolSize
public int getCorePoolSize()
- Specified by:
getCorePoolSize in interface DefaultGravityMBean
setCorePoolSize
public void setCorePoolSize(int corePoolSize)
- Specified by:
setCorePoolSize in interface DefaultGravityMBean
getKeepAliveTimeMillis
public long getKeepAliveTimeMillis()
- Specified by:
getKeepAliveTimeMillis in interface DefaultGravityMBean
setKeepAliveTimeMillis
public void setKeepAliveTimeMillis(long keepAliveTimeMillis)
- Specified by:
setKeepAliveTimeMillis in interface DefaultGravityMBean
getMaximumPoolSize
public int getMaximumPoolSize()
- Specified by:
getMaximumPoolSize in interface DefaultGravityMBean
setMaximumPoolSize
public void setMaximumPoolSize(int maximumPoolSize)
- Specified by:
setMaximumPoolSize in interface DefaultGravityMBean
getQueueCapacity
public int getQueueCapacity()
- Specified by:
getQueueCapacity in interface DefaultGravityMBean
getQueueRemainingCapacity
public int getQueueRemainingCapacity()
- Specified by:
getQueueRemainingCapacity in interface DefaultGravityMBean
getQueueSize
public int getQueueSize()
- Specified by:
getQueueSize in interface DefaultGravityMBean
createChannel
protected Channel createChannel()
getChannel
public Channel getChannel(String channelId)
- Specified by:
getChannel in interface Gravity
removeChannel
public Channel removeChannel(String channelId)
- Specified by:
removeChannel in interface Gravity
access
public boolean access(String channelId)
- Specified by:
access in interface Gravity
execute
public void execute(AsyncChannelRunner runner)
- Specified by:
execute in interface Gravity
cancel
public boolean cancel(AsyncChannelRunner runner)
- Specified by:
cancel in interface Gravity
handleMessage
public Message handleMessage(Message message)
- Specified by:
handleMessage in interface Gravity
handleMessage
public Message handleMessage(Message message,
boolean skipInterceptor)
- Specified by:
handleMessage in interface Gravity
initThread
public GraniteContext initThread()
- Specified by:
initThread in interface Gravity
releaseThread
public void releaseThread()
- Specified by:
releaseThread 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
postManage
protected void postManage(Channel channel)