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

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)
           
 BuddyGroup getBuddyGroup()
           
 org.jgroups.Channel getChannel()
          Gets the channel the cache is using.
 org.jgroups.ChannelFactory getMuxChannelFactory()
          Gets the factory the cache will use to create a multiplexed channel.
 NodeFactory getNodeFactory()
           
 RPCManager getRPCManager()
           
 TransactionManager getTransactionManager()
           
 int hashCode()
           
 void reset()
          Resets the runtime to default values.
 void setBuddyGroup(BuddyGroup buddyGroup)
           
 void setChannel(org.jgroups.Channel channel)
          Sets the channel the cache will use.
 void setMuxChannelFactory(org.jgroups.ChannelFactory multiplexerChannelFactory)
          Sets the factory the cache should use to create a multiplexed channel.
 void setNodeFactory(NodeFactory nodeFactory)
           
 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 {@link #setChannel(Channel)}. If the channel factory is set, {@link Configuration#setMultiplexerStack(String)} must also be set, or a CacheException will be thrown during cache startup.

Parameters:
multiplexerChannelFactory -

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 -

getTransactionManager

public TransactionManager getTransactionManager()

setTransactionManager

public void setTransactionManager(TransactionManager transactionManager)

getNodeFactory

public NodeFactory getNodeFactory()

setNodeFactory

public void setNodeFactory(NodeFactory nodeFactory)

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
Overrides:
clone in class ConfigurationComponent
Throws:
CloneNotSupportedException


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