org.jboss.cache.config
Class Configuration

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

public class Configuration
extends ConfigurationComponent

Encapsulates the configuration of a Cache.

Author:
Manik Surtani (manik@jboss.org)
See Also:
Serialized Form

Nested Class Summary
static class Configuration.CacheMode
          Cache replication mode.
static class Configuration.NodeLockingScheme
          Cache node locking scheme.
static class Configuration.ShutdownHookBehavior
          Behavior of the JVM shutdown hook registered by the cache
 
Field Summary
static short DEFAULT_REPLICATION_VERSION
          Default replication version, from Version.getVersionShort().
 
Fields inherited from class org.jboss.cache.config.ConfigurationComponent
log
 
Constructor Summary
Configuration()
           
 
Method Summary
 Configuration clone()
           
 boolean equals(Object o)
           
 BuddyReplicationConfig getBuddyReplicationConfig()
           
 CacheLoaderConfig getCacheLoaderConfig()
           
 Configuration.CacheMode getCacheMode()
           
 String getCacheModeString()
           
 String getClusterConfig()
           
 String getClusterName()
           
 URL getDefaultClusterConfig()
          Returns a URL to a default JGroups configuration file.
 EvictionConfig getEvictionConfig()
           
 boolean getExposeManagementStatistics()
           
 IsolationLevel getIsolationLevel()
           
 String getIsolationLevelString()
           
 long getLockAcquisitionTimeout()
           
 Marshaller getMarshaller()
           
 String getMarshallerClass()
           
 String getMultiplexerStack()
           
 Configuration.NodeLockingScheme getNodeLockingScheme()
           
 String getNodeLockingSchemeString()
           
 int getObjectInputStreamPoolSize()
           
 int getObjectOutputStreamPoolSize()
           
 short getReplicationVersion()
           
 long getReplQueueInterval()
           
 int getReplQueueMaxElements()
           
 String getReplVersionString()
           
 RuntimeConfig getRuntimeConfig()
           
 Configuration.ShutdownHookBehavior getShutdownHookBehavior()
           
 long getStateRetrievalTimeout()
           
 long getSyncReplTimeout()
           
 String getTransactionManagerLookupClass()
           
 int hashCode()
           
 boolean isFetchInMemoryState()
           
 boolean isInactiveOnStartup()
           
 boolean isLockParentForChildInsertRemove()
          Gets whether inserting or removing a node requires a write lock on the node's parent (when pessimistic locking is used.)

The default value is false

 boolean isNodeLockingOptimistic()
           
 boolean isSyncCommitPhase()
           
 boolean isSyncRollbackPhase()
           
 boolean isUseLazyDeserialization()
           
 boolean isUseRegionBasedMarshalling()
          Deprecated. 
 boolean isUseReplQueue()
           
 boolean isUsingBuddyReplication()
           
 boolean isUsingCacheLoaders()
           
 boolean isUsingMultiplexer()
           
static Configuration.CacheMode legacyModeToCacheMode(int legacyMode)
           
 void setBuddyReplicationConfig(BuddyReplicationConfig config)
           
 void setCacheLoaderConfig(CacheLoaderConfig config)
           
 void setCacheMarshaller(Marshaller instance)
           
 void setCacheMode(Configuration.CacheMode cacheModeInt)
           
 void setCacheMode(String cacheMode)
           
 void setCacheModeString(String cacheMode)
           
 void setClusterConfig(Element config)
          Converts a list of elements to a Java Groups property string.
 void setClusterConfig(String clusterConfig)
           
 void setClusterName(String clusterName)
           
 void setEvictionConfig(EvictionConfig config)
           
 void setExposeManagementStatistics(boolean useMbean)
           
 void setFetchInMemoryState(boolean fetchInMemoryState)
           
 void setInactiveOnStartup(boolean inactiveOnStartup)
           
 void setIsolationLevel(IsolationLevel isolationLevel)
           
 void setIsolationLevel(String isolationLevel)
           
 void setIsolationLevelString(String isolationLevel)
           
 void setLockAcquisitionTimeout(long lockAcquisitionTimeout)
           
 void setLockParentForChildInsertRemove(boolean lockParentForChildInsertRemove)
          Sets whether inserting or removing a node requires a write lock on the node's parent (when pessimistic locking is used.)

The default value is false

 void setMarshallerClass(String marshallerClass)
           
 void setMultiplexerStack(String stackName)
           
 void setNodeLockingOptimistic(boolean nodeLockingOptimistic)
           
 void setNodeLockingScheme(Configuration.NodeLockingScheme nodeLockingScheme)
           
 void setNodeLockingScheme(String nodeLockingScheme)
           
 void setNodeLockingSchemeString(String nodeLockingScheme)
           
 void setObjectInputStreamPoolSize(int objectInputStreamPoolSize)
          Initialises the size of the object input stream pool size, which defaults to 50.
 void setObjectOutputStreamPoolSize(int objectOutputStreamPoolSize)
          Initialises the size of the object output stream pool size, which defaults to 50.
 void setReplicationVersion(short replicationVersion)
           
 void setReplQueueInterval(long replQueueInterval)
           
 void setReplQueueMaxElements(int replQueueMaxElements)
           
 void setReplVersionString(String replVersionString)
           
 void setRuntimeConfig(RuntimeConfig runtimeConfig)
           
 void setShutdownHookBehavior(Configuration.ShutdownHookBehavior shutdownHookBehavior)
           
 void setShutdownHookBehavior(String shutdownHookBehavior)
           
 void setStateRetrievalTimeout(long stateRetrievalTimeout)
           
 void setSyncCommitPhase(boolean syncCommitPhase)
           
 void setSyncReplTimeout(long syncReplTimeout)
           
 void setSyncRollbackPhase(boolean syncRollbackPhase)
           
 void setTransactionManagerLookupClass(String transactionManagerLookupClass)
           
 void setUseLazyDeserialization(boolean useLazyDeserialization)
           
 void setUseRegionBasedMarshalling(boolean useRegionBasedMarshalling)
          Deprecated. 
 void setUseReplQueue(boolean useReplQueue)
           
 void setUsingMultiplexer(boolean usingMultiplexer)
           
 
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
 

Field Detail

DEFAULT_REPLICATION_VERSION

public static final short DEFAULT_REPLICATION_VERSION
Default replication version, from Version.getVersionShort().

Constructor Detail

Configuration

public Configuration()
Method Detail

setCacheMarshaller

public void setCacheMarshaller(Marshaller instance)

getMarshaller

public Marshaller getMarshaller()

legacyModeToCacheMode

public static Configuration.CacheMode legacyModeToCacheMode(int legacyMode)

setClusterConfig

public void setClusterConfig(Element config)
Converts a list of elements to a Java Groups property string.


setClusterName

public void setClusterName(String clusterName)

setClusterConfig

public void setClusterConfig(String clusterConfig)

setReplQueueMaxElements

public void setReplQueueMaxElements(int replQueueMaxElements)

setReplQueueInterval

public void setReplQueueInterval(long replQueueInterval)

setExposeManagementStatistics

public void setExposeManagementStatistics(boolean useMbean)

setFetchInMemoryState

public void setFetchInMemoryState(boolean fetchInMemoryState)

setReplicationVersion

public void setReplicationVersion(short replicationVersion)

setReplVersionString

public void setReplVersionString(String replVersionString)

setLockAcquisitionTimeout

public void setLockAcquisitionTimeout(long lockAcquisitionTimeout)

setSyncReplTimeout

public void setSyncReplTimeout(long syncReplTimeout)

setCacheMode

public void setCacheMode(Configuration.CacheMode cacheModeInt)

setCacheMode

public void setCacheMode(String cacheMode)

getCacheModeString

public String getCacheModeString()

setCacheModeString

public void setCacheModeString(String cacheMode)

setInactiveOnStartup

public void setInactiveOnStartup(boolean inactiveOnStartup)

getEvictionConfig

public EvictionConfig getEvictionConfig()

setEvictionConfig

public void setEvictionConfig(EvictionConfig config)

setUseRegionBasedMarshalling

@Deprecated
public void setUseRegionBasedMarshalling(boolean useRegionBasedMarshalling)
Deprecated. 

This is a deprecated configuration option. While it will be supported for the 2.x series for backward compatibility, expect to see it disappear in 3.x.

With isUseLazyDeserialization(), which is enabled by default, custom class loaders are handled implicitly. See the user guide for details on how this is handled.


setTransactionManagerLookupClass

public void setTransactionManagerLookupClass(String transactionManagerLookupClass)

setCacheLoaderConfig

public void setCacheLoaderConfig(CacheLoaderConfig config)

setSyncCommitPhase

public void setSyncCommitPhase(boolean syncCommitPhase)

setSyncRollbackPhase

public void setSyncRollbackPhase(boolean syncRollbackPhase)

setBuddyReplicationConfig

public void setBuddyReplicationConfig(BuddyReplicationConfig config)

setNodeLockingScheme

public void setNodeLockingScheme(Configuration.NodeLockingScheme nodeLockingScheme)

setUseReplQueue

public void setUseReplQueue(boolean useReplQueue)

setIsolationLevel

public void setIsolationLevel(IsolationLevel isolationLevel)

setNodeLockingOptimistic

public void setNodeLockingOptimistic(boolean nodeLockingOptimistic)

setStateRetrievalTimeout

public void setStateRetrievalTimeout(long stateRetrievalTimeout)

setNodeLockingScheme

public void setNodeLockingScheme(String nodeLockingScheme)

getNodeLockingSchemeString

public String getNodeLockingSchemeString()

setNodeLockingSchemeString

public void setNodeLockingSchemeString(String nodeLockingScheme)

setIsolationLevel

public void setIsolationLevel(String isolationLevel)

getIsolationLevelString

public String getIsolationLevelString()

setIsolationLevelString

public void setIsolationLevelString(String isolationLevel)

setLockParentForChildInsertRemove

public void setLockParentForChildInsertRemove(boolean lockParentForChildInsertRemove)
Sets whether inserting or removing a node requires a write lock on the node's parent (when pessimistic locking is used.)

The default value is false


setMultiplexerStack

public void setMultiplexerStack(String stackName)

isUsingMultiplexer

public boolean isUsingMultiplexer()

setUsingMultiplexer

public void setUsingMultiplexer(boolean usingMultiplexer)

setShutdownHookBehavior

public void setShutdownHookBehavior(Configuration.ShutdownHookBehavior shutdownHookBehavior)

setShutdownHookBehavior

public void setShutdownHookBehavior(String shutdownHookBehavior)

setUseLazyDeserialization

public void setUseLazyDeserialization(boolean useLazyDeserialization)

setObjectInputStreamPoolSize

public void setObjectInputStreamPoolSize(int objectInputStreamPoolSize)
Initialises the size of the object input stream pool size, which defaults to 50.

Parameters:
objectInputStreamPoolSize -
Since:
2.1.0

setObjectOutputStreamPoolSize

public void setObjectOutputStreamPoolSize(int objectOutputStreamPoolSize)
Initialises the size of the object output stream pool size, which defaults to 50.

Parameters:
objectOutputStreamPoolSize -
Since:
2.1.0

getShutdownHookBehavior

public Configuration.ShutdownHookBehavior getShutdownHookBehavior()

isNodeLockingOptimistic

public boolean isNodeLockingOptimistic()

isUseReplQueue

public boolean isUseReplQueue()

getClusterName

public String getClusterName()

getClusterConfig

public String getClusterConfig()

getReplQueueMaxElements

public int getReplQueueMaxElements()

getReplQueueInterval

public long getReplQueueInterval()

getExposeManagementStatistics

public boolean getExposeManagementStatistics()

isFetchInMemoryState

public boolean isFetchInMemoryState()

getReplicationVersion

public short getReplicationVersion()

getReplVersionString

public String getReplVersionString()

getLockAcquisitionTimeout

public long getLockAcquisitionTimeout()

getSyncReplTimeout

public long getSyncReplTimeout()

getCacheMode

public Configuration.CacheMode getCacheMode()

isInactiveOnStartup

public boolean isInactiveOnStartup()

getIsolationLevel

public IsolationLevel getIsolationLevel()

isLockParentForChildInsertRemove

public boolean isLockParentForChildInsertRemove()
Gets whether inserting or removing a node requires a write lock on the node's parent (when pessimistic locking is used.)

The default value is false


isUseRegionBasedMarshalling

@Deprecated
public boolean isUseRegionBasedMarshalling()
Deprecated. 

This is a deprecated configuration option. While it will be supported for the 2.x series for backward compatibility, expect to see it disappear in 3.x.

With isUseLazyDeserialization(), which is enabled by default, custom class loaders are handled implicitly. See the user guide for details on how this is handled.


getTransactionManagerLookupClass

public String getTransactionManagerLookupClass()

getCacheLoaderConfig

public CacheLoaderConfig getCacheLoaderConfig()

isSyncCommitPhase

public boolean isSyncCommitPhase()

isSyncRollbackPhase

public boolean isSyncRollbackPhase()

getBuddyReplicationConfig

public BuddyReplicationConfig getBuddyReplicationConfig()

getNodeLockingScheme

public Configuration.NodeLockingScheme getNodeLockingScheme()

getStateRetrievalTimeout

public long getStateRetrievalTimeout()

getMultiplexerStack

public String getMultiplexerStack()

isUseLazyDeserialization

public boolean isUseLazyDeserialization()

getRuntimeConfig

public RuntimeConfig getRuntimeConfig()

setRuntimeConfig

public void setRuntimeConfig(RuntimeConfig runtimeConfig)

getMarshallerClass

public String getMarshallerClass()

setMarshallerClass

public void setMarshallerClass(String marshallerClass)

getObjectInputStreamPoolSize

public int getObjectInputStreamPoolSize()
Returns:
the size of he object input stream pool
Since:
2.1.0

getObjectOutputStreamPoolSize

public int getObjectOutputStreamPoolSize()
Returns:
the size of he object output stream pool
Since:
2.1.0

getDefaultClusterConfig

public URL getDefaultClusterConfig()
Returns a URL to a default JGroups configuration file.

Returns:
a default JGroups config file

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

clone

public Configuration clone()
                    throws CloneNotSupportedException
Overrides:
clone in class ConfigurationComponent
Throws:
CloneNotSupportedException

isUsingCacheLoaders

public boolean isUsingCacheLoaders()

isUsingBuddyReplication

public boolean isUsingBuddyReplication()


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