org.jboss.cache
Interface TreeCacheMBean

All Superinterfaces:
org.jboss.system.Service, org.jboss.system.ServiceMBean
All Known Subinterfaces:
PojoCacheMBean, RpcTreeCacheMBean, TreeCacheAopMBean
All Known Implementing Classes:
MarshalledTreeCache, PojoCache, RpcTreeCache, TreeCache, TreeCacheAop

public interface TreeCacheMBean
extends org.jboss.system.ServiceMBean

MBean interface.

Version:
$Id: TreeCacheMBean.java,v 1.35 2006/06/08 01:28:51 bstansberry Exp $
Author:
Bela Ban, Ben Wang

Field Summary
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Method Summary
 void _put(GlobalTransaction tx, Fqn fqn, java.util.Map data, boolean create_undo_ops)
          Does the real work.
 void _put(GlobalTransaction tx, Fqn fqn, java.util.Map data, boolean create_undo_ops, boolean erase_contents)
          Does the real work.
 java.lang.Object _put(GlobalTransaction tx, Fqn fqn, java.lang.Object key, java.lang.Object value, boolean create_undo_ops)
           
 void _put(GlobalTransaction tx, java.lang.String fqn, java.util.Map data, boolean create_undo_ops)
          Does the real work.
 java.lang.Object _put(GlobalTransaction tx, java.lang.String fqn, java.lang.Object key, java.lang.Object value, boolean create_undo_ops)
           
 void _remove(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops)
           
 java.lang.Object _remove(GlobalTransaction tx, Fqn fqn, java.lang.Object key, boolean create_undo_ops)
           
 void _remove(GlobalTransaction tx, java.lang.String fqn, boolean create_undo_ops)
           
 java.lang.Object _remove(GlobalTransaction tx, java.lang.String fqn, java.lang.Object key, boolean create_undo_ops)
           
 void activateRegion(java.lang.String subtreeFqn)
          Causes the cache to transfer state for the subtree rooted at subtreeFqn and to begin accepting replication messages for that subtree.
 void addTreeCacheListener(TreeCacheListener listener)
           
 java.util.List callRemoteMethods(java.util.Vector members, java.lang.reflect.Method method, java.lang.Object[] args, boolean synchronous, boolean exclude_self, long timeout)
           
 java.util.List callRemoteMethods(java.util.Vector members, java.lang.String method_name, java.lang.Class[] types, java.lang.Object[] args, boolean synchronous, boolean exclude_self, long timeout)
           
 void createService()
           
 void destroyService()
           
 java.lang.String dumpTransactionTable()
          Dumps the contents of the TransactionTable
 void evict(Fqn fqn)
          Called by eviction policy provider.
 boolean exists(Fqn fqn)
          Checks whether a given node exists in the tree.
 boolean exists(Fqn fqn, java.lang.Object key)
          Checks whether a given key exists in the given node.
 boolean exists(java.lang.String fqn)
          Checks whether a given node exists in the tree
 boolean exists(java.lang.String fqn, java.lang.Object key)
           
 void fetchState(long timeout)
          Fetch the group state from the current coordinator.
 Node get(Fqn fqn)
           
 java.lang.Object get(Fqn fqn, java.lang.Object key)
          Finds a node given its name and returns the value associated with a given key in its data map.
 java.lang.Object get(Fqn fqn, java.lang.Object key, boolean sendNodeEvent, Option option)
          The same as calling get(Fqn, Object, boolean) except that you can pass in options for this specific method invocation.
 java.lang.Object get(Fqn fqn, java.lang.Object key, Option option)
          The same as calling get(Fqn, Object) except that you can pass in options for this specific method invocation.
 DataNode get(Fqn fqn, Option option)
          The same as calling get(Fqn) except that you can pass in options for this specific method invocation.
 Node get(java.lang.String fqn)
           
 java.lang.Object get(java.lang.String fqn, java.lang.Object key)
          Finds a node given its name and returns the value associated with a given key in its data map.
 org.w3c.dom.Element getBuddyReplicationConfig()
          Retrieves the buddy replication cofiguration element
 CacheLoader getCacheLoader()
           
 boolean getCacheLoaderAsynchronous()
          Deprecated.  
 java.lang.String getCacheLoaderClass()
          Deprecated.  
 java.util.Properties getCacheLoaderConfig()
          Deprecated.  
 org.w3c.dom.Element getCacheLoaderConfiguration()
           
 boolean getCacheLoaderFetchPersistentState()
          Deprecated.  
 boolean getCacheLoaderFetchTransientState()
          Deprecated.  
 boolean getCacheLoaderPassivation()
          Deprecated.  
 java.lang.String getCacheLoaderPreload()
          Deprecated.  
 boolean getCacheLoaderShared()
          Deprecated.  
 java.lang.String getCacheMode()
          Returns the current caching mode.
 java.util.Set getChildrenNames(Fqn fqn)
          Returns all children of a given node
 java.util.Set getChildrenNames(Fqn fqn, Option option)
          The same as calling getChildrenNames(Fqn) except that you can pass in options for this specific method invocation.
 java.util.Set getChildrenNames(java.lang.String fqn)
          Returns all children of a given node
 java.lang.String getClusterName()
          Get the name of the replication group
 java.lang.String getClusterProperties()
          Get the cluster properties (e.g.
 boolean getDeadlockDetection()
           
 java.lang.String getEvictionPolicyClass()
          Returns the name of the cache eviction policy (must be an implementation of EvictionPolicy)
 int getEvictionThreadWakeupIntervalSeconds()
          Obtain eviction thread (if any) wake up interval in seconds
 boolean getFetchInMemoryState()
          Returns whether or not any initial state transfer or subsequent partial state transfer following an activateRegion call should include in-memory state.
 boolean getFetchStateOnStartup()
          Returns whether or not on startup the initial state will be acquired from existing members.
 long getInitialStateRetrievalTimeout()
          Get the max time to wait until the initial state is retrieved.
 TreeCache getInstance()
          Returns a reference to the TreeCache object itself.
 java.lang.String getInterceptorChain()
           
 java.util.List getInterceptors()
           
 java.lang.String getIsolationLevel()
          Returns the transaction isolation level.
 java.util.Set getKeys(Fqn fqn)
           
 java.util.Set getKeys(java.lang.String fqn)
           
 java.lang.Object getLocalAddress()
           
 long getLockAcquisitionTimeout()
          Default max time to wait for a lock.
 java.util.Vector getMembers()
           
 java.lang.String getMultiplexerService()
          Retrieves the JGroups multiplexer service name if defined.
 java.lang.String getMultiplexerStack()
          Retrieves the JGroups multiplexer stack name if defined.
 java.lang.String getNodeLockingScheme()
           
 int getNumberOfAttributes()
          Returns an approximation of the total number of attributes in the tree.
 int getNumberOfLocksHeld()
          Gets the number of read or write locks held across the entire tree
 int getNumberOfNodes()
          Returns an approximation of the total number of nodes in the tree.
 org.w3c.dom.Element getPojoCacheConfig()
           
 java.lang.String getReplicationVersion()
          Gets the format version of the data transferred during an initial state transfer or a call to activateRegion(String).
 long getReplQueueInterval()
           
 int getReplQueueMaxElements()
           
 short getStateTransferVersion()
          Deprecated. use getReplicationVersion() instead
 boolean getSyncCommitPhase()
           
 long getSyncReplTimeout()
          Returns the default max timeout after which synchronous replication calls return.
 boolean getSyncRollbackPhase()
           
 javax.transaction.TransactionManager getTransactionManager()
           
 java.lang.String getTransactionManagerLookupClass()
           
 boolean getUseInterceptorMbeans()
          Gets whether the cache should register its interceptor mbeans.
 boolean getUseMarshalling()
          Deprecated.  
 boolean getUseRegionBasedMarshalling()
          Tests whether region based marshaling s used.
 boolean getUseReplQueue()
           
 java.lang.String getVersion()
           
 void inactivateRegion(java.lang.String subtreeFqn)
          Causes the cache to stop accepting replication events for the subtree rooted at subtreeFqn and evict all nodes in that subtree.
 boolean isCoordinator()
           
 boolean isInactiveOnStartup()
          Gets whether the entire tree is inactive upon startup, only responding to replication messages after activateRegion(String) is called to activate one or more parts of the tree.
 boolean isUsingEviction()
           
 void load(java.lang.String fqn)
          Loads the indicated Fqn, plus all parents recursively from the CacheLoader.
 java.lang.String print(Fqn fqn)
          Prints a representation of the node defined by fqn.
 java.lang.String print(java.lang.String fqn)
          Prints a representation of the node defined by fqn.
 java.lang.String printDetails()
           
 java.lang.String printLockInfo()
           
 void purgeCacheLoaders()
          Purges the contents of all configured CacheLoaders
 void put(Fqn fqn, java.util.Map data)
          Adds a new node to the tree and sets its data.
 void put(Fqn fqn, java.util.Map data, Option option)
          The same as calling put(Fqn, Map) except that you can pass in options for this specific method invocation.
 java.lang.Object put(Fqn fqn, java.lang.Object key, java.lang.Object value)
          Adds a key and value to a given node.
 void put(Fqn fqn, java.lang.Object key, java.lang.Object value, Option option)
          The same as calling put(Fqn, Object, Object) except that you can pass in options for this specific method invocation.
 void put(java.lang.String fqn, java.util.Map data)
          Adds a new node to the tree and sets its data.
 java.lang.Object put(java.lang.String fqn, java.lang.Object key, java.lang.Object value)
          Adds a key and value to a given node.
 void registerClassLoader(java.lang.String fqn, java.lang.ClassLoader cl)
          Registers the given classloader with TreeCacheMarshaller for use in unmarshalling replicated objects for the specified region.
 void releaseAllLocks(Fqn fqn)
          Force-releases all locks in this node and the entire subtree
 void releaseAllLocks(java.lang.String fqn)
          Force-releases all locks in this node and the entire subtree
 void remove(Fqn fqn)
          Removes the node from the tree.
 java.lang.Object remove(Fqn fqn, java.lang.Object key)
          Removes key from the node's hashmap
 java.lang.Object remove(Fqn fqn, java.lang.Object key, Option option)
          The same as calling remove(Fqn, Object) except that you can pass in options for this specific method invocation.
 void remove(Fqn fqn, Option option)
          The same as calling remove(Fqn) except that you can pass in options for this specific method invocation.
 void remove(java.lang.String fqn)
          Removes the node from the tree.
 java.lang.Object remove(java.lang.String fqn, java.lang.Object key)
          Removes key from the node's hashmap
 void removeData(Fqn fqn)
           
 void removeData(java.lang.String fqn)
           
 void removeTreeCacheListener(TreeCacheListener listener)
           
 void setBuddyReplicationConfig(org.w3c.dom.Element config)
          Sets the buddy replication configuration element
 void setCacheLoader(CacheLoader loader)
          Deprecated.  
 void setCacheLoaderAsynchronous(boolean b)
          Deprecated.  
 void setCacheLoaderClass(java.lang.String cache_loader_class)
          Deprecated.  
 void setCacheLoaderConfig(java.util.Properties cache_loader_config)
          Deprecated.  
 void setCacheLoaderConfiguration(org.w3c.dom.Element cache_loader_config)
           
 void setCacheLoaderFetchPersistentState(boolean flag)
          Deprecated.  
 void setCacheLoaderFetchTransientState(boolean flag)
          Deprecated.  
 void setCacheLoaderPassivation(boolean passivate)
          Deprecated.  
 void setCacheLoaderPreload(java.lang.String list)
          Deprecated.  
 void setCacheLoaderShared(boolean shared)
          Deprecated.  
 void setCacheMode(java.lang.String mode)
          Sets the default caching mode)
 void setClusterConfig(org.w3c.dom.Element config)
          Convert a list of elements to the JG property string
 void setClusterName(java.lang.String name)
          Set the name of the replication group
 void setClusterProperties(java.lang.String cluster_props)
          Set the cluster properties.
 void setDeadlockDetection(boolean dt)
           
 void setEvictionPolicyClass(java.lang.String eviction_policy_class)
          Sets the classname of the eviction policy
 void setEvictionPolicyConfig(org.w3c.dom.Element config)
          Setup eviction policy configuration
 void setFetchInMemoryState(boolean flag)
          Sets whether or not any initial or subsequent partial state transfer should include in-memory state.
 void setFetchStateOnStartup(boolean flag)
          Deprecated. will just log a warning; use setFetchInMemoryState and any cache loader's setFetchPersistentState property
 void setInactiveOnStartup(boolean inactiveOnStartup)
          Sets whether the entire tree is inactive upon startup, only responding to replication messages after activateRegion(String) is called to activate one or more parts of the tree.
 void setInitialStateRetrievalTimeout(long timeout)
          Set the initial state transfer timeout (see getInitialStateRetrievalTimeout())
 void setIsolationLevel(java.lang.String level)
          Set the transaction isolation level.
 void setLockAcquisitionTimeout(long timeout)
          Set the max time for lock acquisition.
 void setMultiplexerService(java.lang.String serviceName)
          Sets the JGroups multiplexer service name.
 void setMultiplexerStack(java.lang.String stackName)
          Used with JGroups multiplexer, specifies stack to be used (e.g., fc-fast-minimalthreads) This attribute is optional; if not provided, a default multiplexer stack will be used.
 void setNodeLockingScheme(java.lang.String nodeLockingScheme)
           
 void setPojoCacheConfig(org.w3c.dom.Element config)
           
 void setReplicationVersion(java.lang.String version)
          Sets the format version of the data transferred during an initial state transfer or a call to activateRegion(String).
 void setReplQueueInterval(long interval)
           
 void setReplQueueMaxElements(int max_elements)
           
 void setStateTransferVersion(short version)
          Deprecated. use setReplicationVersion(String) instead
 void setSyncCommitPhase(boolean sync_commit_phase)
           
 void setSyncReplTimeout(long timeout)
          Sets the default maximum wait time for synchronous replication to receive all results
 void setSyncRollbackPhase(boolean sync_rollback_phase)
           
 void setTransactionManagerLookup(TransactionManagerLookup l)
          Sets the TransactionManagerLookup object
 void setTransactionManagerLookupClass(java.lang.String cl)
          Sets the class of the TransactionManagerLookup impl.
 void setUseMarshalling(boolean isTrue)
          Deprecated.  
 void setUseRegionBasedMarshalling(boolean isTrue)
          Sets whether marshalling uses scoped class loaders on a per region basis.
 void setUseReplQueue(boolean flag)
           
 void startService()
           
 void stopService()
           
 java.lang.String toString()
           
 void unregisterClassLoader(java.lang.String fqn)
          Instructs the TreeCacheMarshaller to no longer use a special classloader to unmarshal replicated objects for the specified region.
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Method Detail

getLocalAddress

java.lang.Object getLocalAddress()

getMembers

java.util.Vector getMembers()

isCoordinator

boolean isCoordinator()

getClusterName

java.lang.String getClusterName()
Get the name of the replication group


getVersion

java.lang.String getVersion()

setClusterName

void setClusterName(java.lang.String name)
Set the name of the replication group


setUseMarshalling

void setUseMarshalling(boolean isTrue)
Deprecated. 

Sets whether a TreeCacheMarshaller instance should be created to manage different classloaders to use for unmarshalling replicated objects.

This property must be set to true before any call to registerClassLoader(String, ClassLoader) or activateRegion(String)

TreeCacheMarshaller is ALWAYS used. This is now synonymous with setUseRegionBasedMarshalling()


getUseMarshalling

boolean getUseMarshalling()
Deprecated. 

Gets whether a TreeCacheMarshaller instance should be used to manage different classloaders to use for unmarshalling replicated objects. TreeCacheMarshaller is ALWAYS used. This is now synonymous with getUseRegionBasedMarshalling()


setUseRegionBasedMarshalling

void setUseRegionBasedMarshalling(boolean isTrue)
Sets whether marshalling uses scoped class loaders on a per region basis.

This property must be set to true before any call to registerClassLoader(String, ClassLoader) or activateRegion(String)

Parameters:
isTrue -

getUseRegionBasedMarshalling

boolean getUseRegionBasedMarshalling()
Tests whether region based marshaling s used.

Returns:
true if region based marshalling is used.

getUseInterceptorMbeans

boolean getUseInterceptorMbeans()
Gets whether the cache should register its interceptor mbeans. These mbeans are used to capture and publish interceptor statistics.

Returns:
true if mbeans should be registered for each interceptor

isUsingEviction

boolean isUsingEviction()

registerClassLoader

void registerClassLoader(java.lang.String fqn,
                         java.lang.ClassLoader cl)
                         throws RegionNameConflictException
Registers the given classloader with TreeCacheMarshaller for use in unmarshalling replicated objects for the specified region.

Parameters:
fqn - The fqn region. This fqn and its children will use this classloader for (un)marshalling.
cl - The class loader to use
Throws:
RegionNameConflictException - if fqn is a descendant of an FQN that already has a classloader registered.
java.lang.IllegalStateException - if useMarshalling is false

unregisterClassLoader

void unregisterClassLoader(java.lang.String fqn)
                           throws RegionNotFoundException
Instructs the TreeCacheMarshaller to no longer use a special classloader to unmarshal replicated objects for the specified region.

Parameters:
fqn - The fqn of the root node of region.
Throws:
RegionNotFoundException - if no classloader has been registered for fqn.
java.lang.IllegalStateException - if useMarshalling is false

getClusterProperties

java.lang.String getClusterProperties()
Get the cluster properties (e.g. the protocol stack specification in case of JGroups)


setClusterProperties

void setClusterProperties(java.lang.String cluster_props)
Set the cluster properties. If the cache is to use the new properties, it has to be redeployed

Parameters:
cluster_props - The properties for the cluster (JGroups)

dumpTransactionTable

java.lang.String dumpTransactionTable()
Dumps the contents of the TransactionTable


getInterceptorChain

java.lang.String getInterceptorChain()

getInterceptors

java.util.List getInterceptors()

getCacheLoaderConfiguration

org.w3c.dom.Element getCacheLoaderConfiguration()

setCacheLoaderConfiguration

void setCacheLoaderConfiguration(org.w3c.dom.Element cache_loader_config)

getCacheLoader

CacheLoader getCacheLoader()

getSyncCommitPhase

boolean getSyncCommitPhase()

setSyncCommitPhase

void setSyncCommitPhase(boolean sync_commit_phase)

getSyncRollbackPhase

boolean getSyncRollbackPhase()

setSyncRollbackPhase

void setSyncRollbackPhase(boolean sync_rollback_phase)

setEvictionPolicyConfig

void setEvictionPolicyConfig(org.w3c.dom.Element config)
Setup eviction policy configuration


setClusterConfig

void setClusterConfig(org.w3c.dom.Element config)
Convert a list of elements to the JG property string


getInitialStateRetrievalTimeout

long getInitialStateRetrievalTimeout()
Get the max time to wait until the initial state is retrieved. This is used in a replicating cache: when a new cache joins the cluster, it needs to acquire the (replicated) state of the other members to initialize itself. If no state has been received within timeout milliseconds, the map will be empty.

Returns:
long Number of milliseconds to wait for the state. 0 means to wait forever.

setInitialStateRetrievalTimeout

void setInitialStateRetrievalTimeout(long timeout)
Set the initial state transfer timeout (see getInitialStateRetrievalTimeout())


getCacheMode

java.lang.String getCacheMode()
Returns the current caching mode. Valid values are

setCacheMode

void setCacheMode(java.lang.String mode)
                  throws java.lang.Exception
Sets the default caching mode)

Throws:
java.lang.Exception

getSyncReplTimeout

long getSyncReplTimeout()
Returns the default max timeout after which synchronous replication calls return.

Returns:
long Number of milliseconds after which a sync repl call must return. 0 means to wait forever

setSyncReplTimeout

void setSyncReplTimeout(long timeout)
Sets the default maximum wait time for synchronous replication to receive all results


getUseReplQueue

boolean getUseReplQueue()

setUseReplQueue

void setUseReplQueue(boolean flag)

getReplQueueInterval

long getReplQueueInterval()

setReplQueueInterval

void setReplQueueInterval(long interval)

getReplQueueMaxElements

int getReplQueueMaxElements()

setReplQueueMaxElements

void setReplQueueMaxElements(int max_elements)

setPojoCacheConfig

void setPojoCacheConfig(org.w3c.dom.Element config)
                        throws CacheException
Throws:
CacheException

getPojoCacheConfig

org.w3c.dom.Element getPojoCacheConfig()

getIsolationLevel

java.lang.String getIsolationLevel()
Returns the transaction isolation level.


setIsolationLevel

void setIsolationLevel(java.lang.String level)
Set the transaction isolation level. This determines the locking strategy to be used


getFetchStateOnStartup

boolean getFetchStateOnStartup()
Returns whether or not on startup the initial state will be acquired from existing members.

Returns:
true if isInactiveOnStartup() is false, buddy replication is not configured and either getFetchInMemoryState() is true or a cache loader's FetchPersistentState property is true.

getFetchInMemoryState

boolean getFetchInMemoryState()
Returns whether or not any initial state transfer or subsequent partial state transfer following an activateRegion call should include in-memory state. Allows for warm/hot caches (true/false). The characteristics of a state transfer can be further defined by a cache loader's FetchPersistentState property.


setFetchStateOnStartup

void setFetchStateOnStartup(boolean flag)
Deprecated. will just log a warning; use setFetchInMemoryState and any cache loader's setFetchPersistentState property

Non-functional method maintained for compile time compatibility.


setFetchInMemoryState

void setFetchInMemoryState(boolean flag)
Sets whether or not any initial or subsequent partial state transfer should include in-memory state.


getStateTransferVersion

short getStateTransferVersion()
Deprecated. use getReplicationVersion() instead

Gets the format version of the data transferred during an initial state transfer or a call to activateRegion(String). Different releases of JBossCache may format this data differently; this property identifies the format version being used by this cache instance.

The default value for this property is TreeCache.DEFAULT_REPLICATION_VERSION.

Returns:
a short identifying JBossCache release; e.g. 124 for JBossCache 1.2.4

setStateTransferVersion

void setStateTransferVersion(short version)
Deprecated. use setReplicationVersion(String) instead

Sets the format version of the data transferred during an initial state transfer or a call to activateRegion(String). Different releases of JBossCache may format this data differently; this property identifies the format version being used by this cache instance. Setting this property to a value other than the default allows a cache instance from a later release to interoperate with a cache instance from an earlier release.

Parameters:
version - a short identifying JBossCache release; e.g. 124 for JBossCache 1.2.4

getReplicationVersion

java.lang.String getReplicationVersion()
Gets the format version of the data transferred during an initial state transfer or a call to activateRegion(String). Different releases of JBossCache may format this data differently; this property identifies the format version being used by this cache instance.

The default value for this property is TreeCache.DEFAULT_REPLICATION_VERSION.

Returns:
a short identifying JBossCache release; e.g. 124 for JBossCache 1.2.4

setReplicationVersion

void setReplicationVersion(java.lang.String version)
Sets the format version of the data transferred during an initial state transfer or a call to activateRegion(String). Different releases of JBossCache may format this data differently; this property identifies the format version being used by this cache instance. Setting this property to a value other than the default allows a cache instance from a later release to interoperate with a cache instance from an earlier release.

Parameters:
version - a short identifying JBossCache release; e.g. 124 for JBossCache 1.2.4

getLockAcquisitionTimeout

long getLockAcquisitionTimeout()
Default max time to wait for a lock. If the lock cannot be acquired within this time, a LockingException will be thrown.

Returns:
long Max number of milliseconds to wait for a lock to be acquired

setLockAcquisitionTimeout

void setLockAcquisitionTimeout(long timeout)
Set the max time for lock acquisition. A value of 0 means to wait forever (not recomended). Note that lock acquisition timeouts may be removed in the future when we have deadlock detection.

Parameters:
timeout -

getDeadlockDetection

boolean getDeadlockDetection()

setDeadlockDetection

void setDeadlockDetection(boolean dt)

getEvictionPolicyClass

java.lang.String getEvictionPolicyClass()
Returns the name of the cache eviction policy (must be an implementation of EvictionPolicy)

Returns:
Fully qualified name of a class implementing the EvictionPolicy interface

setEvictionPolicyClass

void setEvictionPolicyClass(java.lang.String eviction_policy_class)
Sets the classname of the eviction policy


getEvictionThreadWakeupIntervalSeconds

int getEvictionThreadWakeupIntervalSeconds()
Obtain eviction thread (if any) wake up interval in seconds


setTransactionManagerLookup

void setTransactionManagerLookup(TransactionManagerLookup l)
Sets the TransactionManagerLookup object

Parameters:
l -

getTransactionManagerLookupClass

java.lang.String getTransactionManagerLookupClass()

setTransactionManagerLookupClass

void setTransactionManagerLookupClass(java.lang.String cl)
                                      throws java.lang.Exception
Sets the class of the TransactionManagerLookup impl. This will attempt to create an instance, and will throw an exception if this fails.

Parameters:
cl -
Throws:
java.lang.Exception

getTransactionManager

javax.transaction.TransactionManager getTransactionManager()

getInstance

TreeCache getInstance()
Returns a reference to the TreeCache object itself. Note that acquiring such a reference in a JMX managed environment causes tight coupling between the client using the cache and the cache service, thus negating one of the key benefits of using JMX.


fetchState

void fetchState(long timeout)
                throws org.jgroups.ChannelClosedException,
                       org.jgroups.ChannelNotConnectedException
Fetch the group state from the current coordinator. If successful, this will trigger setState().

Throws:
org.jgroups.ChannelClosedException
org.jgroups.ChannelNotConnectedException

addTreeCacheListener

void addTreeCacheListener(TreeCacheListener listener)

removeTreeCacheListener

void removeTreeCacheListener(TreeCacheListener listener)

createService

void createService()
                   throws java.lang.Exception
Throws:
java.lang.Exception

destroyService

void destroyService()

startService

void startService()
                  throws java.lang.Exception
Throws:
java.lang.Exception

load

void load(java.lang.String fqn)
          throws java.lang.Exception
Loads the indicated Fqn, plus all parents recursively from the CacheLoader. If no CacheLoader is present, this is a no-op

Parameters:
fqn -
Throws:
java.lang.Exception

stopService

void stopService()

getKeys

java.util.Set getKeys(java.lang.String fqn)
                      throws CacheException
Throws:
CacheException

getKeys

java.util.Set getKeys(Fqn fqn)
                      throws CacheException
Throws:
CacheException

get

java.lang.Object get(java.lang.String fqn,
                     java.lang.Object key)
                     throws CacheException
Finds a node given its name and returns the value associated with a given key in its data map. Returns null if the node was not found in the tree or the key was not found in the hashmap.

Parameters:
fqn - The fully qualified name of the node.
key - The key.
Throws:
CacheException

get

java.lang.Object get(Fqn fqn,
                     java.lang.Object key)
                     throws CacheException
Finds a node given its name and returns the value associated with a given key in its data map. Returns null if the node was not found in the tree or the key was not found in the hashmap.

Parameters:
fqn - The fully qualified name of the node.
key - The key.
Throws:
CacheException

get

Node get(java.lang.String fqn)
         throws CacheException
Throws:
CacheException

get

Node get(Fqn fqn)
         throws CacheException
Throws:
CacheException

exists

boolean exists(java.lang.String fqn)
Checks whether a given node exists in the tree

Parameters:
fqn - The fully qualified name of the node
Returns:
boolean Whether or not the node exists

exists

boolean exists(Fqn fqn)
Checks whether a given node exists in the tree. Does not acquire any locks in doing so (result may be dirty read)

Parameters:
fqn - The fully qualified name of the node
Returns:
boolean Whether or not the node exists

exists

boolean exists(java.lang.String fqn,
               java.lang.Object key)

exists

boolean exists(Fqn fqn,
               java.lang.Object key)
Checks whether a given key exists in the given node. Does not interact with CacheLoader, so the behavior is different from get(Fqn,Object)

Parameters:
fqn - The fully qualified name of the node
key -
Returns:
boolean Whether or not the node exists

put

void put(java.lang.String fqn,
         java.util.Map data)
         throws CacheException
Adds a new node to the tree and sets its data. If the node doesn not yet exist, it will be created. Also, parent nodes will be created if not existent. If the node already has data, then the new data will override the old one. If the node already existed, a nodeModified() notification will be generated. Otherwise a nodeCreated() motification will be emitted.

Parameters:
fqn - The fully qualified name of the new node
data - The new data. May be null if no data should be set in the node.
Throws:
CacheException

put

void put(Fqn fqn,
         java.util.Map data)
         throws CacheException
Adds a new node to the tree and sets its data. If the node doesn not yet exist, it will be created. Also, parent nodes will be created if not existent. If the node already has data, then the new data will override the old one. If the node already existed, a nodeModified() notification will be generated. Otherwise a nodeCreated() motification will be emitted.

Parameters:
fqn - The fully qualified name of the new node
data - The new data. May be null if no data should be set in the node.
Throws:
CacheException

put

java.lang.Object put(java.lang.String fqn,
                     java.lang.Object key,
                     java.lang.Object value)
                     throws CacheException
Adds a key and value to a given node. If the node doesn't exist, it will be created. If the node already existed, a nodeModified() notification will be generated. Otherwise a nodeCreated() motification will be emitted.

Parameters:
fqn - The fully qualified name of the node
key - The key
value - The value
Returns:
Object The previous value (if any), if node was present
Throws:
CacheException

put

java.lang.Object put(Fqn fqn,
                     java.lang.Object key,
                     java.lang.Object value)
                     throws CacheException
Adds a key and value to a given node. If the node doesn't exist, it will be created. If the node already existed, a nodeModified() notification will be generated. Otherwise a nodeCreated() motification will be emitted.

Parameters:
fqn - The fully qualified name of the node
key - The key
value - The value
Returns:
Object The previous value (if any), if node was present
Throws:
CacheException

remove

void remove(java.lang.String fqn)
            throws CacheException
Removes the node from the tree.

Parameters:
fqn - The fully qualified name of the node.
Throws:
CacheException

remove

void remove(Fqn fqn)
            throws CacheException
Removes the node from the tree.

Parameters:
fqn - The fully qualified name of the node.
Throws:
CacheException

evict

void evict(Fqn fqn)
           throws CacheException
Called by eviction policy provider. Note that eviction is done only in local mode, that is, it doesn't replicate the node removal. This is will cause the replcation nodes not synchronizing, but it is ok since user is supposed to add the node again when get is null. After that, the contents will be in sync.

Parameters:
fqn - Will remove everythign assoicated with this fqn.
Throws:
CacheException

remove

java.lang.Object remove(java.lang.String fqn,
                        java.lang.Object key)
                        throws CacheException
Removes key from the node's hashmap

Parameters:
fqn - The fullly qualified name of the node
key - The key to be removed
Returns:
The previous value, or null if none was associated with the given key
Throws:
CacheException

remove

java.lang.Object remove(Fqn fqn,
                        java.lang.Object key)
                        throws CacheException
Removes key from the node's hashmap

Parameters:
fqn - The fullly qualified name of the node
key - The key to be removed
Returns:
The previous value, or null if none was associated with the given key
Throws:
CacheException

removeData

void removeData(java.lang.String fqn)
                throws CacheException
Throws:
CacheException

removeData

void removeData(Fqn fqn)
                throws CacheException
Throws:
CacheException

releaseAllLocks

void releaseAllLocks(java.lang.String fqn)
Force-releases all locks in this node and the entire subtree

Parameters:
fqn -

releaseAllLocks

void releaseAllLocks(Fqn fqn)
Force-releases all locks in this node and the entire subtree

Parameters:
fqn -

print

java.lang.String print(java.lang.String fqn)
Prints a representation of the node defined by fqn. Output includes name, fqn and data.


print

java.lang.String print(Fqn fqn)
Prints a representation of the node defined by fqn. Output includes name, fqn and data.


getChildrenNames

java.util.Set getChildrenNames(java.lang.String fqn)
                               throws CacheException
Returns all children of a given node

Parameters:
fqn - The fully qualified name of the node
Returns:
Set A list of child names (as Strings)
Throws:
CacheException

getChildrenNames

java.util.Set getChildrenNames(Fqn fqn)
                               throws CacheException
Returns all children of a given node

Parameters:
fqn - The fully qualified name of the node
Returns:
Set A list of child names (as Objects). Must not be modified because this would modify the underlying node directly (will throw an exception if modification is attempted). Returns null of the parent node was not found, or if there are no children
Throws:
CacheException

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object

printDetails

java.lang.String printDetails()

printLockInfo

java.lang.String printLockInfo()

getNumberOfLocksHeld

int getNumberOfLocksHeld()
Gets the number of read or write locks held across the entire tree


getNumberOfNodes

int getNumberOfNodes()
Returns an approximation of the total number of nodes in the tree. Since this method doesn't acquire any locks, the number might be incorrect, or the method might even throw a ConcurrentModificationException


getNumberOfAttributes

int getNumberOfAttributes()
Returns an approximation of the total number of attributes in the tree. Since this method doesn't acquire any locks, the number might be incorrect, or the method might even throw a ConcurrentModificationException


callRemoteMethods

java.util.List callRemoteMethods(java.util.Vector members,
                                 java.lang.reflect.Method method,
                                 java.lang.Object[] args,
                                 boolean synchronous,
                                 boolean exclude_self,
                                 long timeout)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

callRemoteMethods

java.util.List callRemoteMethods(java.util.Vector members,
                                 java.lang.String method_name,
                                 java.lang.Class[] types,
                                 java.lang.Object[] args,
                                 boolean synchronous,
                                 boolean exclude_self,
                                 long timeout)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

_put

void _put(GlobalTransaction tx,
          java.lang.String fqn,
          java.util.Map data,
          boolean create_undo_ops)
          throws CacheException
Does the real work. Needs to acquire locks if accessing nodes, depending on the value of locking. If run inside a transaction, needs to (a) add newly acquired locks to TransactionEntry's lock list, (b) add nodes that were created to TransactionEntry's node list and (c) create Modifications and add them to TransactionEntry's modification list and (d) create compensating modifications to undo the changes in case of a rollback

Parameters:
fqn -
data -
create_undo_ops - If true, undo operations will be created (default is true). Otherwise they will not be created (used by rollback()).
Throws:
CacheException

_put

void _put(GlobalTransaction tx,
          Fqn fqn,
          java.util.Map data,
          boolean create_undo_ops)
          throws CacheException
Does the real work. Needs to acquire locks if accessing nodes, depending on the value of locking. If run inside a transaction, needs to (a) add newly acquired locks to TransactionEntry's lock list, (b) add nodes that were created to TransactionEntry's node list and (c) create Modifications and add them to TransactionEntry's modification list and (d) create compensating modifications to undo the changes in case of a rollback

Parameters:
fqn -
data -
create_undo_ops - If true, undo operations will be created (default is true). Otherwise they will not be created (used by rollback()).
Throws:
CacheException

_put

void _put(GlobalTransaction tx,
          Fqn fqn,
          java.util.Map data,
          boolean create_undo_ops,
          boolean erase_contents)
          throws CacheException
Does the real work. Needs to acquire locks if accessing nodes, depending on the value of locking. If run inside a transaction, needs to (a) add newly acquired locks to TransactionEntry's lock list, (b) add nodes that were created to TransactionEntry's node list and (c) create Modifications and add them to TransactionEntry's modification list and (d) create compensating modifications to undo the changes in case of a rollback

Parameters:
fqn -
data -
create_undo_ops - If true, undo operations will be created (default is true).
erase_contents - Clear the existing hashmap before putting the new data into it Otherwise they will not be created (used by rollback()).
Throws:
CacheException

_put

java.lang.Object _put(GlobalTransaction tx,
                      java.lang.String fqn,
                      java.lang.Object key,
                      java.lang.Object value,
                      boolean create_undo_ops)
                      throws CacheException
Throws:
CacheException

_put

java.lang.Object _put(GlobalTransaction tx,
                      Fqn fqn,
                      java.lang.Object key,
                      java.lang.Object value,
                      boolean create_undo_ops)
                      throws CacheException
Throws:
CacheException

_remove

void _remove(GlobalTransaction tx,
             java.lang.String fqn,
             boolean create_undo_ops)
             throws CacheException
Throws:
CacheException

_remove

void _remove(GlobalTransaction tx,
             Fqn fqn,
             boolean create_undo_ops)
             throws CacheException
Throws:
CacheException

_remove

java.lang.Object _remove(GlobalTransaction tx,
                         java.lang.String fqn,
                         java.lang.Object key,
                         boolean create_undo_ops)
                         throws CacheException
Throws:
CacheException

_remove

java.lang.Object _remove(GlobalTransaction tx,
                         Fqn fqn,
                         java.lang.Object key,
                         boolean create_undo_ops)
                         throws CacheException
Throws:
CacheException

setNodeLockingScheme

void setNodeLockingScheme(java.lang.String nodeLockingScheme)

getNodeLockingScheme

java.lang.String getNodeLockingScheme()

activateRegion

void activateRegion(java.lang.String subtreeFqn)
                    throws RegionNotEmptyException,
                           RegionNameConflictException,
                           CacheException
Causes the cache to transfer state for the subtree rooted at subtreeFqn and to begin accepting replication messages for that subtree.

NOTE: This method will cause the creation of a node in the local tree at subtreeFqn whether or not that node exists anywhere else in the cluster. If the node does not exist elsewhere, the local node will be empty. The creation of this node will not be replicated.

Parameters:
subtreeFqn - Fqn string indicating the uppermost node in the portion of the tree that should be activated.
Throws:
RegionNotEmptyException - if the node subtreeFqn exists and has either data or children
java.lang.IllegalStateException - if useMarshalling is false
RegionNameConflictException
CacheException

inactivateRegion

void inactivateRegion(java.lang.String subtreeFqn)
                      throws RegionNameConflictException,
                             CacheException
Causes the cache to stop accepting replication events for the subtree rooted at subtreeFqn and evict all nodes in that subtree.

Parameters:
subtreeFqn - Fqn string indicating the uppermost node in the portion of the tree that should be activated.
Throws:
RegionNameConflictException - if subtreeFqn indicates a node that is part of another subtree that is being specially managed (either by activate/inactiveRegion() or by registerClassLoader())
CacheException - if there is a problem evicting nodes
java.lang.IllegalStateException - if useMarshalling is false

isInactiveOnStartup

boolean isInactiveOnStartup()
Gets whether the entire tree is inactive upon startup, only responding to replication messages after activateRegion(String) is called to activate one or more parts of the tree.

This property is only relevant if getUseMarshalling() is true.


setInactiveOnStartup

void setInactiveOnStartup(boolean inactiveOnStartup)
Sets whether the entire tree is inactive upon startup, only responding to replication messages after activateRegion(String) is called to activate one or more parts of the tree.

This property is only relevant if getUseMarshalling() is true.


get

DataNode get(Fqn fqn,
             Option option)
             throws CacheException
The same as calling get(Fqn) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
option -
Returns:
Throws:
CacheException

get

java.lang.Object get(Fqn fqn,
                     java.lang.Object key,
                     Option option)
                     throws CacheException
The same as calling get(Fqn, Object) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
option -
Returns:
Throws:
CacheException

get

java.lang.Object get(Fqn fqn,
                     java.lang.Object key,
                     boolean sendNodeEvent,
                     Option option)
                     throws CacheException
The same as calling get(Fqn, Object, boolean) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
option -
Returns:
Throws:
CacheException

remove

void remove(Fqn fqn,
            Option option)
            throws CacheException
The same as calling remove(Fqn) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
option -
Throws:
CacheException

remove

java.lang.Object remove(Fqn fqn,
                        java.lang.Object key,
                        Option option)
                        throws CacheException
The same as calling remove(Fqn, Object) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
key -
option -
Throws:
CacheException

getChildrenNames

java.util.Set getChildrenNames(Fqn fqn,
                               Option option)
                               throws CacheException
The same as calling getChildrenNames(Fqn) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
option -
Returns:
Throws:
CacheException

put

void put(Fqn fqn,
         java.util.Map data,
         Option option)
         throws CacheException
The same as calling put(Fqn, Map) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
data -
option -
Throws:
CacheException

put

void put(Fqn fqn,
         java.lang.Object key,
         java.lang.Object value,
         Option option)
         throws CacheException
The same as calling put(Fqn, Object, Object) except that you can pass in options for this specific method invocation. Option

Parameters:
fqn -
key -
value -
option -
Throws:
CacheException

setCacheLoaderClass

void setCacheLoaderClass(java.lang.String cache_loader_class)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoaderConfig

void setCacheLoaderConfig(java.util.Properties cache_loader_config)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoaderShared

void setCacheLoaderShared(boolean shared)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoaderPassivation

void setCacheLoaderPassivation(boolean passivate)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoaderPreload

void setCacheLoaderPreload(java.lang.String list)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoaderAsynchronous

void setCacheLoaderAsynchronous(boolean b)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoaderFetchPersistentState

void setCacheLoaderFetchPersistentState(boolean flag)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoaderFetchTransientState

void setCacheLoaderFetchTransientState(boolean flag)
Deprecated. 

See Also:
setCacheLoaderConfiguration(org.w3c.dom.Element)

setCacheLoader

void setCacheLoader(CacheLoader loader)
Deprecated. 

Provided for backwards compat.

Parameters:
loader -

getCacheLoaderClass

java.lang.String getCacheLoaderClass()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


getCacheLoaderShared

boolean getCacheLoaderShared()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


getCacheLoaderPassivation

boolean getCacheLoaderPassivation()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


getCacheLoaderAsynchronous

boolean getCacheLoaderAsynchronous()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


getCacheLoaderPreload

java.lang.String getCacheLoaderPreload()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


getCacheLoaderFetchPersistentState

boolean getCacheLoaderFetchPersistentState()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


getCacheLoaderFetchTransientState

boolean getCacheLoaderFetchTransientState()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


getCacheLoaderConfig

java.util.Properties getCacheLoaderConfig()
Deprecated. 

provided for backward compat. Use getCacheLoaderConfiguration() instead.


setBuddyReplicationConfig

void setBuddyReplicationConfig(org.w3c.dom.Element config)
Sets the buddy replication configuration element

Parameters:
config -

getBuddyReplicationConfig

org.w3c.dom.Element getBuddyReplicationConfig()
Retrieves the buddy replication cofiguration element

Returns:
config

getMultiplexerService

java.lang.String getMultiplexerService()
Retrieves the JGroups multiplexer service name if defined.

Returns:
the multiplexer service name

setMultiplexerService

void setMultiplexerService(java.lang.String serviceName)
Sets the JGroups multiplexer service name. This attribute is optional; if not provided, a JGroups JChannel will be used

Parameters:
serviceName - the multiplexer service name

getMultiplexerStack

java.lang.String getMultiplexerStack()
Retrieves the JGroups multiplexer stack name if defined.

Returns:
the multiplexer stack name

setMultiplexerStack

void setMultiplexerStack(java.lang.String stackName)
Used with JGroups multiplexer, specifies stack to be used (e.g., fc-fast-minimalthreads) This attribute is optional; if not provided, a default multiplexer stack will be used.

Parameters:
stackName - the name of the multiplexer stack

purgeCacheLoaders

void purgeCacheLoaders()
                       throws java.lang.Exception
Purges the contents of all configured CacheLoaders

Throws:
java.lang.Exception


Copyright 1998-2005 JBoss Inc . All Rights Reserved.