org.jboss.cache.config
Class RuntimeConfig

java.lang.Object
  extended by org.jboss.cache.config.ConfigurationComponent
      extended by org.jboss.cache.config.RuntimeConfig
All Implemented Interfaces:
Serializable, Cloneable, CloneableConfigurationComponent

public class RuntimeConfig
extends ConfigurationComponent

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.cache.config.ConfigurationComponent
log
 
Constructor Summary
RuntimeConfig()
           
 
Method Summary
 RuntimeConfig clone()
           
 boolean equals(Object obj)
           
 ExecutorService getAsyncCacheListenerExecutor()
          This is only relevant if the async cache listener executor has been set using setAsyncCacheListenerExecutor(java.util.concurrent.ExecutorService).
 ExecutorService getAsyncSerializationExecutor()
          This is only relevant if the async cache replication executor has been set using setAsyncSerializationExecutor(java.util.concurrent.ExecutorService).
 BuddyGroup getBuddyGroup()
           
 org.jgroups.Channel getChannel()
          Gets the channel the cache is using.
 org.jgroups.util.ThreadFactory getEvictionTimerThreadFactory()
          This is only relevant if an eviction timer thread factory has been set using setEvictionTimerThreadFactory(org.jgroups.util.ThreadFactory).
 org.jgroups.ChannelFactory getMuxChannelFactory()
          Gets the factory the cache will use to create a multiplexed channel.
 RPCManager getRPCManager()
           
 TransactionManager getTransactionManager()
           
 int hashCode()
           
 void reset()
          Resets the runtime to default values.
 void setAsyncCacheListenerExecutor(ExecutorService asyncCacheListenerExecutor)
          This is used to set the executor to use for async cache listeners, and effectively overrides Configuration.setListenerAsyncPoolSize(int)

 void setAsyncSerializationExecutor(ExecutorService asyncSerializationExecutor)
          This is used to set the executor to use for async cache replucation, and effectively overrides Configuration.setSerializationExecutorPoolSize(int)

 void setBuddyGroup(BuddyGroup buddyGroup)
           
 void setChannel(org.jgroups.Channel channel)
          Sets the channel the cache will use.
 void setEvictionTimerThreadFactory(org.jgroups.util.ThreadFactory evictionTimerThreadFactory)
          Sets the eviction timer thread factory to use when creating a scheduled executor.
 void setMuxChannelFactory(org.jgroups.ChannelFactory multiplexerChannelFactory)
          Sets the factory the cache should use to create a multiplexed channel.
 void setRPCManager(RPCManager rpcManager)
           
 void setTransactionManager(TransactionManager transactionManager)
           
 
Methods inherited from class org.jboss.cache.config.ConfigurationComponent
addChildConfig, addChildConfigs, passCacheToChildConfig, removeChildConfig, removeChildConfigs, replaceChildConfig, replaceChildConfigs, setCache, testImmutability
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeConfig

public RuntimeConfig()
Method Detail

reset

public void reset()
Resets the runtime to default values.


getMuxChannelFactory

public org.jgroups.ChannelFactory getMuxChannelFactory()
Gets the factory the cache will use to create a multiplexed channel.

Returns:
the channel, or null if not set

setMuxChannelFactory

public void setMuxChannelFactory(org.jgroups.ChannelFactory multiplexerChannelFactory)
Sets the factory the cache should use to create a multiplexed channel. Ignored if a Channel is directly configured via setChannel(Channel). If the channel factory is set, Configuration.setMultiplexerStack(String) must also be set, or a CacheException will be thrown during cache startup.

Parameters:
multiplexerChannelFactory - channel factory

getChannel

public org.jgroups.Channel getChannel()
Gets the channel the cache is using.

External callers should use extreme care if they access the channel. The cache expects it has exclusive access to the channel; external code trying to send or receive messages via the channel will almost certainly disrupt the operation of the cache.

Returns:
the channel. May return null if the channel was not externally set via setChannel(Channel) and the cache has not yet been started.
See Also:
setChannel(Channel)

setChannel

public void setChannel(org.jgroups.Channel channel)
Sets the channel the cache will use. The channel should not be connected or closed.

External callers should use extreme care if they access the channel. The cache expects it has exclusive access to the channel; external code trying to send or receive messages via the channel will almost certainly disrupt the operation of the cache.

If an application wishes to send and receive messages using the same underlying channel as the Cache, a multiplexed channel should be used. Two separate mux channels should be created from the same ChannelFactory using the same stack name but different ids. See ChannelFactory.createMultiplexerChannel(String,String,boolean,String). These two mux channels will share the same underlying channel. One of the two mux channels can be injected into the cache; the other can be used by the application. The cache will not see the application messages and vice versa.

Configuring the cache to use a mux channel can also be done by configuring the channel factory and the stack name, in which case the cache will create and use a mux channel.

Parameters:
channel - channel to set

getTransactionManager

public TransactionManager getTransactionManager()

setTransactionManager

public void setTransactionManager(TransactionManager transactionManager)

getEvictionTimerThreadFactory

public org.jgroups.util.ThreadFactory getEvictionTimerThreadFactory()
This is only relevant if an eviction timer thread factory has been set using setEvictionTimerThreadFactory(org.jgroups.util.ThreadFactory). Will return a null if the eviction timer thread factory needs to be created internally.

Returns:
the thread factory used by the eviction timer's scheduled executor.
Since:
3.0

setEvictionTimerThreadFactory

public void setEvictionTimerThreadFactory(org.jgroups.util.ThreadFactory evictionTimerThreadFactory)
Sets the eviction timer thread factory to use when creating a scheduled executor. If this is not set, the eviction timer task will use a default thread factory.

Parameters:
evictionTimerThreadFactory - factory to use
Since:
3.0

getAsyncSerializationExecutor

public ExecutorService getAsyncSerializationExecutor()
This is only relevant if the async cache replication executor has been set using setAsyncSerializationExecutor(java.util.concurrent.ExecutorService). If the executor is created internally, this method will return null.

Returns:
the executor used for async replication.
Since:
3.0

setAsyncSerializationExecutor

public void setAsyncSerializationExecutor(ExecutorService asyncSerializationExecutor)
This is used to set the executor to use for async cache replucation, and effectively overrides Configuration.setSerializationExecutorPoolSize(int)

Parameters:
asyncSerializationExecutor - executor to set
Since:
3.0

getAsyncCacheListenerExecutor

public ExecutorService getAsyncCacheListenerExecutor()
This is only relevant if the async cache listener executor has been set using setAsyncCacheListenerExecutor(java.util.concurrent.ExecutorService). If the executor is created internally, this method will return null.

Returns:
the executor to use for async cache listeners
Since:
3.0

setAsyncCacheListenerExecutor

public void setAsyncCacheListenerExecutor(ExecutorService asyncCacheListenerExecutor)
This is used to set the executor to use for async cache listeners, and effectively overrides Configuration.setListenerAsyncPoolSize(int)

Parameters:
asyncCacheListenerExecutor - the executor to use for async cache listeners
Since:
3.0

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setBuddyGroup

public void setBuddyGroup(BuddyGroup buddyGroup)

getBuddyGroup

public BuddyGroup getBuddyGroup()

setRPCManager

public void setRPCManager(RPCManager rpcManager)

getRPCManager

public RPCManager getRPCManager()

clone

public RuntimeConfig clone()
                    throws CloneNotSupportedException
Specified by:
clone in interface CloneableConfigurationComponent
Overrides:
clone in class ConfigurationComponent
Throws:
CloneNotSupportedException


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.