|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.cache.TreeCache
public class TreeCache
A tree-like structure that is replicated across several members. Updates will
be multicast to all group members reliably and in the same order. User has the
option to set transaction isolation level now (e.g., SERIALIZABLE
, or
REPEATABLE_READ
.
Field Summary | |
---|---|
protected java.util.Set |
activationChangeNodes
Set of Fqns of nodes that are currently being processed by activateReqion or inactivateRegion. |
static java.lang.reflect.Method |
addChildMethodLocal
|
protected int |
cache_mode
|
protected org.w3c.dom.Element |
cacheLoaderConfig
The XML Element from which to configure the CacheLoader |
protected CacheLoaderManager |
cacheLoaderManager
|
protected org.jgroups.JChannel |
channel
|
protected CacheLoaderConfig |
cloaderConfig
for legacy use * |
protected java.lang.String |
cluster_name
|
protected java.lang.String |
cluster_props
|
static java.lang.reflect.Method |
clusteredGetMethod
|
static java.lang.reflect.Method |
commitMethod
|
protected boolean |
coordinator
Am I the coordinator ? |
static short |
DEFAULT_REPLICATION_VERSION
|
protected org.jgroups.blocks.RpcDispatcher |
disp
|
static java.lang.reflect.Method |
enqueueMethodCallMethod
|
protected org.w3c.dom.Element |
evictConfig_
Eviction policy configuration in xml Element |
protected java.lang.String |
eviction_policy_class
|
protected EvictionPolicy |
eviction_policy_provider
Deprecated. DO NOT USE THIS. IT IS HERE FOR EJB3 COMPILATION COMPATIBILITY WITH JBOSSCACHE1.3 |
protected RegionManager |
evictionRegionManager_
RegionManager used by cache eviction |
static java.lang.reflect.Method |
evictNodeMethodLocal
|
static java.lang.reflect.Method |
evictVersionedNodeMethodLocal
|
static java.lang.reflect.Method |
existsMethod
|
protected boolean |
fetchInMemoryState
|
static java.lang.reflect.Method |
getChildrenNamesMethodLocal
|
static java.lang.reflect.Method |
getDataMapMethodLocal
|
static java.lang.reflect.Method |
getKeysMethodLocal
|
static java.lang.reflect.Method |
getKeyValueMethodLocal
|
static java.lang.reflect.Method |
getNodeMethodLocal
|
static java.lang.reflect.Method |
getPartialStateMethod
|
protected boolean |
hasListeners
|
protected boolean |
inactiveOnStartup
|
protected Interceptor |
interceptor_chain
invokeMethod(MethodCall) will dispatch to this chain of interceptors. |
static int |
INVALIDATION_ASYNC
Cache sends evict() calls to remote caches when a node is changed. |
static int |
INVALIDATION_SYNC
Cache sends evict() calls to remote caches when a node is changed. |
protected IsolationLevel |
isolationLevel
|
protected boolean |
isStandalone
|
protected boolean |
isStateSet
|
static int |
LOCAL
Entries in the cache are by default local; ie. |
protected long |
lock_acquisition_timeout
|
static java.lang.reflect.Method |
lockMethodLocal
|
protected static org.apache.commons.logging.Log |
log
|
protected TreeCacheMarshaller |
marshaller_
Marshaller if register to handle marshalling |
protected java.util.Vector |
members
|
protected org.jgroups.MessageListener |
ml
|
protected boolean |
nodeLockingOptimistic
Determines whether to use optimistic locking or not. |
static java.lang.reflect.Method |
notifyCallOnInactiveMethod
|
static java.lang.reflect.Method |
optimisticPrepareMethod
|
static java.lang.reflect.Method |
prepareMethod
|
static java.lang.reflect.Method |
printMethodLocal
|
static java.lang.reflect.Method |
putDataEraseMethodLocal
|
static java.lang.reflect.Method |
putDataMethodLocal
|
static java.lang.reflect.Method |
putFailFastKeyValueMethodLocal
|
static java.lang.reflect.Method |
putKeyValMethodLocal
|
protected java.util.Map |
region_msg_queues
|
protected RegionManager |
regionManager_
RegionManager used by marshaller and ExtendedCacheLoader |
static java.lang.reflect.Method |
releaseAllLocksMethodLocal
|
static java.lang.reflect.Method |
removeDataMethodLocal
|
static java.lang.reflect.Method |
removeKeyMethodLocal
|
static java.lang.reflect.Method |
removeNodeMethodLocal
|
static int |
REPL_ASYNC
Entries in the cache are by default replicated (asynchronously) |
protected ReplicationQueue |
repl_queue
Queue used to replicate updates when mode is repl-async |
protected long |
repl_queue_interval
|
protected int |
repl_queue_max_elements
|
static int |
REPL_SYNC
Entries in the cache are by default replicated (synchronously) |
static java.lang.reflect.Method |
replicateAllMethod
|
static java.lang.reflect.Method |
replicateMethod
|
protected Replicatable |
replication_handler
|
static java.lang.reflect.Method |
rollbackMethod
|
protected DataNode |
root
|
static java.lang.String |
SEPARATOR
|
protected java.lang.Exception |
setStateException
|
protected long |
state_fetch_timeout
|
protected boolean |
sync_commit_phase
synchronous or asynchrous commit phase ? |
protected long |
sync_repl_timeout
|
protected boolean |
sync_rollback_phase
synchronous or asynchrous rollback phase ? |
protected javax.transaction.TransactionManager |
tm
Used to get the Transaction associated with the current thread |
protected TransactionManagerLookup |
tm_lookup
Method to acquire a TransactionManager. |
protected java.lang.String |
tm_lookup_class
Class of the implementation of TransactionManagerLookup |
static java.lang.String |
UNINITIALIZED
|
protected boolean |
use_interceptor_mbeans
|
protected boolean |
use_repl_queue
|
protected boolean |
useCreateService
|
protected boolean |
useMarshalling_
Check to see if we need to use marshalling |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
server, SERVICE_CONTROLLER_SIG, serviceName |
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 |
Constructor Summary | |
---|---|
TreeCache()
|
|
TreeCache(org.jgroups.JChannel channel)
Expects an already connected channel. |
|
TreeCache(java.lang.String cluster_name,
java.lang.String props,
long state_fetch_timeout)
Creates a channel with the given properties. |
Method Summary | |
---|---|
void |
_addChild(GlobalTransaction tx,
Fqn parent_fqn,
java.lang.Object child_name,
DataNode old_node)
Compensating method to _remove(GlobalTransaction,Fqn,boolean) . |
java.util.List |
_clusteredGet(org.jgroups.blocks.MethodCall call)
A 'clustered get' call, received from a remote ClusteredCacheLoader. |
protected void |
_createService()
|
void |
_enqueueMethodCall(java.lang.String subtree,
org.jgroups.blocks.MethodCall call)
|
void |
_evict(Fqn fqn)
Called by eviction policy provider. |
void |
_evict(Fqn fqn,
DataVersion version)
// TODO: MANIK: Document this methodcall |
protected void |
_evictSubtree(Fqn subtree)
Evicts the node at subtree along with all descendant nodes. |
Node |
_get(Fqn fqn)
|
java.lang.Object |
_get(Fqn fqn,
java.lang.Object key,
boolean sendNodeEvent)
|
protected byte[] |
_getAssociatedState(Fqn fqn,
long timeout,
boolean force)
Returns any state stored in the cache that needs to be propagated along with the normal transient state in a subtree when _getState(Fqn, long, boolean, boolean) is called for an Fqn. |
java.util.Set |
_getChildrenNames(Fqn fqn)
|
java.util.Map |
_getData(Fqn fqn)
|
java.util.Set |
_getKeys(Fqn fqn)
|
byte[] |
_getState(Fqn fqn,
long timeout,
boolean force,
boolean suppressErrors)
Returns the state for the portion of the tree named by fqn . |
void |
_lock(Fqn fqn,
int lock_type,
boolean recursive)
|
java.lang.String |
_print(Fqn fqn)
|
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)
|
java.lang.Object |
_put(GlobalTransaction tx,
Fqn fqn,
java.lang.Object key,
java.lang.Object value,
boolean create_undo_ops,
long timeout)
|
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 |
_releaseAllLocks(Fqn fqn)
|
void |
_remove(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops)
|
void |
_remove(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops,
boolean sendNodeEvent)
|
void |
_remove(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops,
boolean sendNodeEvent,
boolean eviction)
Remove a node |
void |
_remove(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops,
boolean sendNodeEvent,
boolean eviction,
DataVersion version)
// TODO: MANIK: Document this methodcall |
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 |
_removeData(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops)
|
void |
_removeData(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops,
boolean sendNodeEvent)
|
void |
_removeData(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops,
boolean sendNodeEvent,
boolean eviction)
|
void |
_removeData(GlobalTransaction tx,
Fqn fqn,
boolean create_undo_ops,
boolean sendNodeEvent,
boolean eviction,
DataVersion version)
|
void |
_removeData(GlobalTransaction tx,
java.lang.String fqn,
boolean create_undo_ops)
|
void |
_replicate(java.util.List method_calls)
|
java.lang.Object |
_replicate(org.jgroups.blocks.MethodCall method_call)
Invoked by the ReplicationInterceptor of other nodes in the cluster, to replicate their changes across the cluster. |
protected void |
acquireLocksForStateTransfer(DataNode root,
java.lang.Object lockOwner,
long timeout,
boolean lockChildren,
boolean force)
|
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)
|
void |
addUndoOperation(GlobalTransaction gtx,
org.jgroups.blocks.MethodCall undo_op)
|
void |
block()
Block sending and receiving of messages until viewAccepted() is called |
java.util.List |
callRemoteMethods(java.util.Vector mbrs,
org.jgroups.blocks.MethodCall method_call,
boolean synchronous,
boolean exclude_self,
long timeout)
Deprecated. Note this is due to be moved to an interceptor. |
java.util.List |
callRemoteMethods(java.util.Vector mbrs,
org.jgroups.blocks.MethodCall method_call,
int mode,
boolean exclude_self,
long timeout)
Deprecated. Note this is due to be moved to an interceptor. |
java.util.List |
callRemoteMethods(java.util.Vector members,
java.lang.reflect.Method method,
java.lang.Object[] args,
boolean synchronous,
boolean exclude_self,
long timeout)
Deprecated. Note this is due to be moved to an interceptor. |
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)
Deprecated. Note this is due to be moved to an interceptor. |
void |
commit(GlobalTransaction tx)
|
void |
createService()
Lifecycle method. |
protected DataNode |
createSubtreeRootNode(Fqn subtree)
|
void |
destroyService()
Lifecycle mthod. |
protected boolean |
determineCoordinator()
|
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. |
protected void |
fetchStateOnStartup()
|
protected void |
forceAcquireLock(DataNode node,
java.lang.Object newOwner,
boolean lockChildren)
Forcibly acquire a read lock on the given node for the given owner, breaking any existing locks that prevent the read lock. |
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. |
protected java.lang.Object |
get(Fqn fqn,
java.lang.Object key,
boolean sendNodeEvent)
|
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. |
CacheLoader |
getCacheLoader()
|
boolean |
getCacheLoaderAsynchronous()
Deprecated. |
java.lang.String |
getCacheLoaderClass()
Deprecated. |
java.util.Properties |
getCacheLoaderConfig()
provided for backward compat. |
org.w3c.dom.Element |
getCacheLoaderConfiguration()
|
boolean |
getCacheLoaderFetchPersistentState()
Deprecated. |
boolean |
getCacheLoaderFetchTransientState()
Deprecated. |
CacheLoaderManager |
getCacheLoaderManager()
|
boolean |
getCacheLoaderPassivation()
Deprecated. |
java.lang.String |
getCacheLoaderPreload()
Deprecated. |
boolean |
getCacheLoaderShared()
Deprecated. |
java.lang.String |
getCacheMode()
Returns the current caching mode. |
int |
getCacheModeInternal()
|
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. |
org.jgroups.Address |
getCoordinator()
|
GlobalTransaction |
getCurrentTransaction()
Get the transaction associated with the current thread and maps it onto a GlobalTransaction . |
GlobalTransaction |
getCurrentTransaction(boolean createIfNotExists)
|
GlobalTransaction |
getCurrentTransaction(javax.transaction.Transaction tx)
|
GlobalTransaction |
getCurrentTransaction(javax.transaction.Transaction tx,
boolean createIfNotExists)
|
boolean |
getDeadlockDetection()
Deprecated. |
protected java.lang.String |
getDefaultProperties()
|
java.lang.String |
getEvictionPolicyClass()
Returns the name of the cache eviction policy (must be an implementation of EvictionPolicy) |
org.w3c.dom.Element |
getEvictionPolicyConfig()
|
RegionManager |
getEvictionRegionManager()
|
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()
|
InvocationContext |
getInvocationContext()
Retrieves an InvocationContext. |
java.lang.String |
getIsolationLevel()
Returns the transaction isolation level. |
IsolationLevel |
getIsolationLevelClass()
|
java.util.Set |
getKeys(Fqn fqn)
|
java.util.Set |
getKeys(java.lang.String fqn)
|
java.lang.Object |
getLocalAddress()
|
protected javax.transaction.Transaction |
getLocalTransaction()
Returns the transaction associated with the current thread. |
long |
getLockAcquisitionTimeout()
Default max time to wait for a lock. |
java.util.Map |
getLockTable()
|
java.util.Vector |
getMembers()
|
org.jgroups.MessageListener |
getMessageListener()
|
java.lang.String |
getNodeLockingScheme()
|
int |
getNumberOfAttributes()
Returns an approximation of the total number of attributes in the tree. |
int |
getNumberOfAttributes(Fqn fqn)
|
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. |
protected java.lang.Object |
getOwnerForLock()
Returns an object suitable for use in node locking, either the current transaction or the current thread if there is no transaction. |
RegionManager |
getRegionManager()
|
java.lang.String |
getReplicationVersion()
Gets the format version of the data transferred during an initial state transfer or a call to TreeCacheMBean.activateRegion(String) . |
short |
getReplicationVersionShort()
|
ReplicationQueue |
getReplQueue()
|
long |
getReplQueueInterval()
|
int |
getReplQueueMaxElements()
|
DataNode |
getRoot()
Used by interceptors. |
byte[] |
getStateBytes()
|
short |
getStateTransferVersion()
Gets the format version of the data transferred during an initial state transfer or a call to TreeCacheMBean.activateRegion(String) . |
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()
|
TransactionTable |
getTransactionTable()
|
java.util.Collection |
getTreeCacheListeners()
Returns a Map contains the listeners to this tree cache |
boolean |
getUseInterceptorMbeans()
Gets whether the cache should register its interceptor mbeans. |
boolean |
getUseMarshalling()
Gets whether a TreeCacheMarshaller instance should be used
to manage different classloaders to use for unmarshalling replicated
objects. |
boolean |
getUseReplQueue()
|
java.lang.String |
getVersion()
|
boolean |
hasChild(Fqn fqn)
|
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. |
protected java.lang.Object |
invokeMethod(org.jgroups.blocks.MethodCall m)
Invokes a method against this object. |
boolean |
isCoordinator()
|
static boolean |
isCrudMethod(java.lang.reflect.Method m)
|
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 |
isNodeLockingOptimistic()
returns whether node locking is optimistic. |
void |
load(java.lang.String fqn)
Loads the indicated Fqn, plus all parents recursively from the CacheLoader. |
protected java.lang.Class |
loadClass(java.lang.String classname)
Loads the specified class using this class's classloader, or, if it is null
(i.e. |
protected void |
notifyAllNodesCreated(DataNode curr)
Generates NodeAdded notifications for all nodes of the tree. |
protected void |
notifyCacheStarted()
|
protected void |
notifyCacheStopped()
|
void |
notifyCallForInactiveSubtree(java.lang.String fqn)
Method provided to JGroups by TreeCacheMarshaller.objectFromByteBuffer(byte[]) when
it receives a replication event for an Fqn that has been marked
as inactive. |
void |
notifyNodeActivate(Fqn fqn,
boolean pre)
|
void |
notifyNodeCreated(Fqn fqn)
|
protected void |
notifyNodeEvict(Fqn fqn,
boolean pre)
|
protected void |
notifyNodeEvicted(Fqn fqn)
|
void |
notifyNodeLoaded(Fqn fqn)
|
protected void |
notifyNodeModified(Fqn fqn)
|
protected void |
notifyNodeModify(Fqn fqn,
boolean pre)
|
void |
notifyNodePassivate(Fqn fqn,
boolean pre)
|
protected void |
notifyNodeRemove(Fqn fqn,
boolean pre)
|
protected void |
notifyNodeRemoved(Fqn fqn)
|
protected void |
notifyNodeVisited(Fqn fqn)
|
protected void |
notifyViewChange(org.jgroups.View v)
|
void |
optimisticPrepare(GlobalTransaction gtx,
java.util.List modifications,
java.util.Map data,
org.jgroups.Address address,
boolean onePhaseCommit)
|
DataNode |
peek(Fqn fqn)
|
java.lang.Object |
peek(Fqn fqn,
java.lang.Object key)
Like get() method but without triggering a node visit event. |
void |
prepare(GlobalTransaction global_tx,
java.util.List modifications,
org.jgroups.Address coord,
boolean onePhaseCommit)
|
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 |
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. |
java.lang.Object |
putFailFast(Fqn fqn,
java.lang.Object key,
java.lang.Object value,
long timeout)
Deprecated. This is a kludge created specifically form the Hibernate 3.0 release. This method should not be used by any application. The methodV will likely be removed in a future release |
java.lang.Object |
putFailFast(java.lang.String fqn,
java.lang.Object key,
java.lang.Object value,
long timeout)
Deprecated. |
void |
registerClassLoader(java.lang.String fqn,
java.lang.ClassLoader cl)
If useMarshalling is true, we will use TreeCacheMarshaller for marshalling. |
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 |
protected void |
releaseStateTransferLocks(DataNode root,
java.lang.Object lockOwner,
boolean childrenLocked)
|
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 |
rollback(GlobalTransaction tx)
|
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 |
setCacheLoaderManager(CacheLoaderManager cacheLoaderManager)
|
void |
setCacheLoaderPassivation(boolean passivate)
Deprecated. |
void |
setCacheLoaderPreload(java.lang.String list)
Deprecated. |
void |
setCacheLoaderShared(boolean shared)
Deprecated. |
void |
setCacheMode(int mode)
Sets the default cache mode. |
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)
Deprecated. |
void |
setEvictionListener(TreeCacheListener listener)
|
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 |
setEvictionPolicyProvider(EvictionPolicy policy)
Deprecated. DO NOT USE THIS METHOD. IT IS PROVIDED FOR FULL JBCACHE 1.2 API BACKWARDS COMPATIBILITY |
void |
setFetchInMemoryState(boolean flag)
Sets whether or not any initial or subsequent partial state transfer should include in-memory state. |
void |
setFetchStateOnStartup(boolean flag)
Sets whether or not on startup to acquire the initial state from existing members. |
void |
setInactiveOnStartup(boolean inactiveOnStartup)
Sets whether the entire tree is inactive upon startup, only responding to replication messages after activateRegion(String) is
called to activage one or more parts of the tree. |
void |
setInitialStateRetrievalTimeout(long timeout)
Set the initial state transfer timeout (see getInitialStateRetrievalTimeout() ) |
void |
setInterceptorChain(Interceptor i)
Used for unit tests only - to force interceptor chains. |
void |
setInvocationContext(InvocationContext invocationContext)
Sets the invocation context |
void |
setIsolationLevel(IsolationLevel level)
|
void |
setIsolationLevel(java.lang.String level)
Set the transaction isolation level. |
void |
setLockAcquisitionTimeout(long timeout)
Set the max time for lock acquisition. |
protected void |
setNodeLockingOptimistic(boolean b)
Sets whether to use optimistic locking on the nodes. |
void |
setNodeLockingScheme(java.lang.String s)
|
void |
setReplication_handler(Replicatable replication_handler)
|
void |
setReplicationVersion(java.lang.String versionString)
Sets the format version of the data transferred during an initial state transfer or a call to TreeCacheMBean.activateRegion(String) . |
void |
setReplQueueInterval(long interval)
|
void |
setReplQueueMaxElements(int max_elements)
|
void |
setStateBytes(byte[] state)
|
void |
setStateTransferVersion(short version)
Sets the format version of the data transferred during an initial state transfer or a call to TreeCacheMBean.activateRegion(String) . |
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 |
setUseInterceptorMbeans(boolean useMbeans)
Specifies whether the cache should register its interceptor mbeans. |
void |
setUseMarshalling(boolean isTrue)
Sets whether a TreeCacheMarshaller instance should be created
to manage different classloaders to use for unmarshalling replicated
objects. |
void |
setUseReplQueue(boolean flag)
|
void |
startService()
Lifecyle method. |
void |
stopService()
Lifecycle method. |
protected int |
string2Mode(java.lang.String mode)
|
void |
suspect(org.jgroups.Address suspected_mbr)
Called when a member is suspected |
java.lang.String |
toString()
|
java.lang.String |
toString(boolean details)
|
void |
unregisterClassLoader(java.lang.String fqn)
If useMarshalling is true, we will use unregister this region. |
void |
viewAccepted(org.jgroups.View new_view)
|
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Field Detail |
---|
public static final short DEFAULT_REPLICATION_VERSION
protected DataNode root
protected boolean hasListeners
protected org.jgroups.JChannel channel
protected boolean coordinator
protected static final org.apache.commons.logging.Log log
protected java.lang.String cluster_name
protected java.lang.String cluster_props
protected final java.util.Vector members
protected org.jgroups.blocks.RpcDispatcher disp
protected org.jgroups.MessageListener ml
protected boolean use_repl_queue
protected int repl_queue_max_elements
protected long repl_queue_interval
protected java.util.Map region_msg_queues
protected boolean use_interceptor_mbeans
protected boolean fetchInMemoryState
protected long lock_acquisition_timeout
protected long state_fetch_timeout
protected long sync_repl_timeout
protected java.lang.String eviction_policy_class
protected int cache_mode
protected boolean inactiveOnStartup
protected boolean isStandalone
public static java.lang.reflect.Method putDataMethodLocal
public static java.lang.reflect.Method putDataEraseMethodLocal
public static java.lang.reflect.Method putKeyValMethodLocal
public static java.lang.reflect.Method putFailFastKeyValueMethodLocal
public static java.lang.reflect.Method removeNodeMethodLocal
public static java.lang.reflect.Method removeKeyMethodLocal
public static java.lang.reflect.Method removeDataMethodLocal
public static java.lang.reflect.Method evictNodeMethodLocal
public static java.lang.reflect.Method evictVersionedNodeMethodLocal
public static java.lang.reflect.Method prepareMethod
public static java.lang.reflect.Method commitMethod
public static java.lang.reflect.Method rollbackMethod
public static java.lang.reflect.Method replicateMethod
public static java.lang.reflect.Method replicateAllMethod
public static java.lang.reflect.Method addChildMethodLocal
public static java.lang.reflect.Method getKeyValueMethodLocal
public static java.lang.reflect.Method getNodeMethodLocal
public static java.lang.reflect.Method getKeysMethodLocal
public static java.lang.reflect.Method getChildrenNamesMethodLocal
public static java.lang.reflect.Method getDataMapMethodLocal
public static java.lang.reflect.Method existsMethod
public static java.lang.reflect.Method releaseAllLocksMethodLocal
public static java.lang.reflect.Method printMethodLocal
public static java.lang.reflect.Method lockMethodLocal
public static java.lang.reflect.Method optimisticPrepareMethod
public static java.lang.reflect.Method getPartialStateMethod
public static java.lang.reflect.Method enqueueMethodCallMethod
public static java.lang.reflect.Method notifyCallOnInactiveMethod
public static java.lang.reflect.Method clusteredGetMethod
protected boolean isStateSet
protected java.lang.Exception setStateException
protected IsolationLevel isolationLevel
protected org.w3c.dom.Element evictConfig_
protected boolean useMarshalling_
protected TreeCacheMarshaller marshaller_
protected RegionManager regionManager_
protected RegionManager evictionRegionManager_
protected Interceptor interceptor_chain
invokeMethod(MethodCall)
will dispatch to this chain of interceptors.
In the future, this will be replaced with JBossAop. This is a first step towards refactoring JBossCache.
protected TransactionManagerLookup tm_lookup
ServiceMBeanSupport.start()
protected java.lang.String tm_lookup_class
protected javax.transaction.TransactionManager tm
protected org.w3c.dom.Element cacheLoaderConfig
protected CacheLoaderManager cacheLoaderManager
protected CacheLoaderConfig cloaderConfig
protected boolean sync_commit_phase
protected boolean sync_rollback_phase
protected EvictionPolicy eviction_policy_provider
protected Replicatable replication_handler
protected ReplicationQueue repl_queue
public static final java.lang.String SEPARATOR
public static final int LOCAL
public static final int REPL_ASYNC
public static final int REPL_SYNC
public static final int INVALIDATION_ASYNC
public static final int INVALIDATION_SYNC
public static final java.lang.String UNINITIALIZED
protected boolean nodeLockingOptimistic
protected boolean useCreateService
protected final java.util.Set activationChangeNodes
Constructor Detail |
---|
public TreeCache(java.lang.String cluster_name, java.lang.String props, long state_fetch_timeout) throws java.lang.Exception
java.lang.Exception
public TreeCache() throws java.lang.Exception
java.lang.Exception
public TreeCache(org.jgroups.JChannel channel) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public org.jgroups.MessageListener getMessageListener()
public static boolean isCrudMethod(java.lang.reflect.Method m)
public java.lang.String getVersion()
getVersion
in interface TreeCacheMBean
public DataNode getRoot()
public java.lang.Object getLocalAddress()
getLocalAddress
in interface TreeCacheMBean
public java.util.Vector getMembers()
getMembers
in interface TreeCacheMBean
public boolean isCoordinator()
isCoordinator
in interface TreeCacheMBean
public java.lang.String getClusterName()
getClusterName
in interface TreeCacheMBean
public void setClusterName(java.lang.String name)
setClusterName
in interface TreeCacheMBean
public java.lang.String getClusterProperties()
getClusterProperties
in interface TreeCacheMBean
public void setClusterProperties(java.lang.String cluster_props)
setClusterProperties
in interface TreeCacheMBean
cluster_props
- The properties for the cluster (JGroups)public TransactionTable getTransactionTable()
public java.util.Map getLockTable()
public java.lang.String dumpTransactionTable()
dumpTransactionTable
in interface TreeCacheMBean
public boolean getDeadlockDetection()
getDeadlockDetection
in interface TreeCacheMBean
public void setDeadlockDetection(boolean dt)
setDeadlockDetection
in interface TreeCacheMBean
dt
- public java.lang.String getInterceptorChain()
getInterceptorChain
in interface TreeCacheMBean
public void setInterceptorChain(Interceptor i)
i
- public java.util.List getInterceptors()
getInterceptors
in interface TreeCacheMBean
public org.w3c.dom.Element getCacheLoaderConfiguration()
getCacheLoaderConfiguration
in interface TreeCacheMBean
public void setReplication_handler(Replicatable replication_handler)
public void setCacheLoaderConfiguration(org.w3c.dom.Element cache_loader_config)
setCacheLoaderConfiguration
in interface TreeCacheMBean
cache_loader_config
- public CacheLoader getCacheLoader()
getCacheLoader
in interface TreeCacheMBean
public boolean isInactiveOnStartup()
activateRegion(String)
is
called to activate one or more parts of the tree.
This property is only relevant if getUseMarshalling()
is
true
.
isInactiveOnStartup
in interface TreeCacheMBean
public void setInactiveOnStartup(boolean inactiveOnStartup)
activateRegion(String)
is
called to activage one or more parts of the tree.
This property is only relevant if getUseMarshalling()
is
true
.
setInactiveOnStartup
in interface TreeCacheMBean
public boolean getSyncCommitPhase()
getSyncCommitPhase
in interface TreeCacheMBean
public void setSyncCommitPhase(boolean sync_commit_phase)
setSyncCommitPhase
in interface TreeCacheMBean
sync_commit_phase
- public boolean getSyncRollbackPhase()
getSyncRollbackPhase
in interface TreeCacheMBean
public void setSyncRollbackPhase(boolean sync_rollback_phase)
setSyncRollbackPhase
in interface TreeCacheMBean
sync_rollback_phase
- public void setEvictionPolicyConfig(org.w3c.dom.Element config)
setEvictionPolicyConfig
in interface TreeCacheMBean
public org.w3c.dom.Element getEvictionPolicyConfig()
public void setClusterConfig(org.w3c.dom.Element config)
setClusterConfig
in interface TreeCacheMBean
public long getInitialStateRetrievalTimeout()
getInitialStateRetrievalTimeout
in interface TreeCacheMBean
public void setInitialStateRetrievalTimeout(long timeout)
getInitialStateRetrievalTimeout()
)
setInitialStateRetrievalTimeout
in interface TreeCacheMBean
public java.lang.String getCacheMode()
getCacheMode
in interface TreeCacheMBean
public int getCacheModeInternal()
public void setNodeLockingScheme(java.lang.String s)
setNodeLockingScheme
in interface TreeCacheMBean
public java.lang.String getNodeLockingScheme()
getNodeLockingScheme
in interface TreeCacheMBean
protected void setNodeLockingOptimistic(boolean b)
public boolean isNodeLockingOptimistic()
public void setCacheMode(java.lang.String mode) throws java.lang.Exception
setCacheMode
in interface TreeCacheMBean
java.lang.Exception
public void setCacheMode(int mode)
mode
- public long getSyncReplTimeout()
getSyncReplTimeout
in interface TreeCacheMBean
public void setSyncReplTimeout(long timeout)
setSyncReplTimeout
in interface TreeCacheMBean
public boolean getUseReplQueue()
getUseReplQueue
in interface TreeCacheMBean
public void setUseReplQueue(boolean flag)
setUseReplQueue
in interface TreeCacheMBean
flag
- public long getReplQueueInterval()
getReplQueueInterval
in interface TreeCacheMBean
public void setReplQueueInterval(long interval)
setReplQueueInterval
in interface TreeCacheMBean
interval
- public int getReplQueueMaxElements()
getReplQueueMaxElements
in interface TreeCacheMBean
public void setReplQueueMaxElements(int max_elements)
setReplQueueMaxElements
in interface TreeCacheMBean
max_elements
- public ReplicationQueue getReplQueue()
public java.lang.String getIsolationLevel()
getIsolationLevel
in interface TreeCacheMBean
public void setIsolationLevel(java.lang.String level)
setIsolationLevel
in interface TreeCacheMBean
public void setIsolationLevel(IsolationLevel level)
level
- public IsolationLevel getIsolationLevelClass()
public boolean getFetchStateOnStartup()
TreeCacheMBean
getFetchStateOnStartup
in interface TreeCacheMBean
true
if TreeCacheMBean.isInactiveOnStartup()
is
false
and either TreeCacheMBean.getFetchInMemoryState()
is true
or a cache loader's
FetchPersistentState
property is true.public void setFetchStateOnStartup(boolean flag)
TreeCacheMBean
setFetchStateOnStartup
in interface TreeCacheMBean
public void setFetchInMemoryState(boolean flag)
TreeCacheMBean
setFetchInMemoryState
in interface TreeCacheMBean
public boolean getFetchInMemoryState()
TreeCacheMBean
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.
getFetchInMemoryState
in interface TreeCacheMBean
public long getLockAcquisitionTimeout()
getLockAcquisitionTimeout
in interface TreeCacheMBean
public void setLockAcquisitionTimeout(long timeout)
setLockAcquisitionTimeout
in interface TreeCacheMBean
timeout
- public java.lang.String getEvictionPolicyClass()
getEvictionPolicyClass
in interface TreeCacheMBean
public void setEvictionPolicyClass(java.lang.String eviction_policy_class)
setEvictionPolicyClass
in interface TreeCacheMBean
public int getEvictionThreadWakeupIntervalSeconds()
getEvictionThreadWakeupIntervalSeconds
in interface TreeCacheMBean
public void setTransactionManagerLookup(TransactionManagerLookup l)
setTransactionManagerLookup
in interface TreeCacheMBean
l
- public java.lang.String getTransactionManagerLookupClass()
getTransactionManagerLookupClass
in interface TreeCacheMBean
public void setTransactionManagerLookupClass(java.lang.String cl) throws java.lang.Exception
setTransactionManagerLookupClass
in interface TreeCacheMBean
cl
-
java.lang.Exception
public javax.transaction.TransactionManager getTransactionManager()
getTransactionManager
in interface TreeCacheMBean
public boolean getUseInterceptorMbeans()
TreeCacheMBean
getUseInterceptorMbeans
in interface TreeCacheMBean
public void setUseInterceptorMbeans(boolean useMbeans)
TreeCacheMBean
setUseInterceptorMbeans
in interface TreeCacheMBean
useMbeans
- true is mbeans should be registered for each cache interceptorpublic TreeCache getInstance()
TreeCacheMBean
getInstance
in interface TreeCacheMBean
public void fetchState(long timeout) throws org.jgroups.ChannelClosedException, org.jgroups.ChannelNotConnectedException
fetchState
in interface TreeCacheMBean
org.jgroups.ChannelClosedException
org.jgroups.ChannelNotConnectedException
public void setEvictionListener(TreeCacheListener listener)
public void addTreeCacheListener(TreeCacheListener listener)
addTreeCacheListener
in interface TreeCacheMBean
listener
- public void removeTreeCacheListener(TreeCacheListener listener)
removeTreeCacheListener
in interface TreeCacheMBean
listener
- public java.util.Collection getTreeCacheListeners()
public void createService() throws java.lang.Exception
create
createService
in interface TreeCacheMBean
createService
in class org.jboss.system.ServiceMBeanSupport
java.lang.Exception
protected void _createService() throws java.lang.Exception
java.lang.Exception
public void startService() throws java.lang.Exception
start
startService
in interface TreeCacheMBean
startService
in class org.jboss.system.ServiceMBeanSupport
java.lang.Exception
public void destroyService()
destroyService
in interface TreeCacheMBean
destroyService
in class org.jboss.system.ServiceMBeanSupport
public void stopService()
stop
.
stopService
in interface TreeCacheMBean
stopService
in class org.jboss.system.ServiceMBeanSupport
public void setEvictionPolicyProvider(EvictionPolicy policy)
public void setUseMarshalling(boolean isTrue)
TreeCacheMBean
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
TreeCacheMBean.registerClassLoader(String, ClassLoader)
or
TreeCacheMBean.activateRegion(String)
setUseMarshalling
in interface TreeCacheMBean
public boolean getUseMarshalling()
TreeCacheMBean
TreeCacheMarshaller
instance should be used
to manage different classloaders to use for unmarshalling replicated
objects.
getUseMarshalling
in interface TreeCacheMBean
public void load(java.lang.String fqn) throws java.lang.Exception
load
in interface TreeCacheMBean
fqn
-
java.lang.Exception
protected boolean determineCoordinator()
public org.jgroups.Address getCoordinator()
public byte[] getStateBytes()
public void setStateBytes(byte[] state)
public void registerClassLoader(java.lang.String fqn, java.lang.ClassLoader cl) throws RegionNameConflictException
useMarshalling
is true, we will use TreeCacheMarshaller
for marshalling.
User will register the specific class loader through this api.
registerClassLoader
in interface TreeCacheMBean
fqn
- The fqn region. Children of this fqn will use this classloader for (un)marshalling.cl
- The class loader to use
RegionNameConflictException
- If there is a conflict in fqn specification.public void unregisterClassLoader(java.lang.String fqn) throws RegionNotFoundException
useMarshalling
is true, we will use unregister this region.
unregisterClassLoader
in interface TreeCacheMBean
fqn
- The fqn region.
RegionNotFoundException
- If there is a conflict in fqn specification.public void activateRegion(java.lang.String subtreeFqn) throws RegionNotEmptyException, RegionNameConflictException, CacheException
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.
activateRegion
in interface TreeCacheMBean
subtreeFqn
- Fqn string indicating the uppermost node in the
portion of the tree that should be activated.
RegionNotEmptyException
- if the node subtreeFqn
exists and has either data or children
java.lang.IllegalStateException
- if useMarshalling
is false
RegionNameConflictException
CacheException
protected DataNode createSubtreeRootNode(Fqn subtree) throws CacheException
CacheException
public void inactivateRegion(java.lang.String subtreeFqn) throws RegionNameConflictException, CacheException
subtreeFqn
and evict all nodes in that subtree.
inactivateRegion
in interface TreeCacheMBean
subtreeFqn
- Fqn string indicating the uppermost node in the
portion of the tree that should be activated.
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
protected void _evictSubtree(Fqn subtree) throws CacheException
subtree
along with all descendant nodes.
subtree
- Fqn indicating the uppermost node in the
portion of the tree that should be evicted.
CacheException
public void _enqueueMethodCall(java.lang.String subtree, org.jgroups.blocks.MethodCall call) throws java.lang.Throwable
java.lang.Throwable
public byte[] _getState(Fqn fqn, long timeout, boolean force, boolean suppressErrors) throws java.lang.Throwable
fqn
.
State returned is a serialized byte[][], element 0 is the transient state
(or null), and element 1 is the persistent state (or null).
fqn
- Fqn indicating the uppermost node in the
portion of the tree whose state should be returned.timeout
- max number of ms this method should wait to acquire
a read lock on the nodes being transferredforce
- if a read lock cannot be acquired after
timeout
ms, should the lock acquisition
be forced, and any existing transactions holding locks
on the nodes be rolled back? NOTE:
In release 1.2.4, this parameter has no effect.suppressErrors
- should any Throwable thrown be suppressed?
java.lang.UnsupportedOperationException
- if persistent state transfer is
enabled, the requested Fqn is not the root node, and the
cache loader does not implement ExtendedCacheLoader
.
java.lang.Throwable
protected byte[] _getAssociatedState(Fqn fqn, long timeout, boolean force) throws java.lang.Exception
_getState(Fqn, long, boolean, boolean)
is called for an Fqn. Typically this would be state
stored outside of the subtree that is somehow associated with the subtree.
This method is designed for overriding by
TreeCacheAop
.
The implementation in this class returns null
.
This method will only be invoked if
getCacheLoaderFetchTransientState()
returns true
.
fqn
- the fqn that represents the root node of the subtree.timeout
- max number of ms this method should wait to acquire
a read lock on the nodes being transferredforce
- if a read lock cannot be acquired after
timeout
ms, should the lock acquisition
be forced, and any existing transactions holding locks
on the nodes be rolled back? NOTE:
In release 1.2.4, this parameter has no effect.
null
. This implementation returns null
.
java.lang.Exception
public java.lang.String getReplicationVersion()
TreeCacheMBean
TreeCacheMBean.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
DEFAULT_REPLICATION_VERSION
.
getReplicationVersion
in interface TreeCacheMBean
124
for JBossCache 1.2.4public void setReplicationVersion(java.lang.String versionString)
TreeCacheMBean
TreeCacheMBean.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.
setReplicationVersion
in interface TreeCacheMBean
versionString
- a short identifying JBossCache release;
e.g. 124
for JBossCache 1.2.4public short getReplicationVersionShort()
public short getStateTransferVersion()
TreeCacheMBean
TreeCacheMBean.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
DEFAULT_REPLICATION_VERSION
.
getStateTransferVersion
in interface TreeCacheMBean
124
for JBossCache 1.2.4public void setStateTransferVersion(short version)
TreeCacheMBean
TreeCacheMBean.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.
setStateTransferVersion
in interface TreeCacheMBean
version
- a short identifying JBossCache release;
e.g. 124
for JBossCache 1.2.4protected void acquireLocksForStateTransfer(DataNode root, java.lang.Object lockOwner, long timeout, boolean lockChildren, boolean force) throws java.lang.Exception
java.lang.Exception
protected void releaseStateTransferLocks(DataNode root, java.lang.Object lockOwner, boolean childrenLocked)
protected void forceAcquireLock(DataNode node, java.lang.Object newOwner, boolean lockChildren)
node
- the nodenewOwner
- the new owner (usually a Thread or GlobalTransaction)lockChildren
- true
if this method should be recursively
applied to node
's children.public void notifyCallForInactiveSubtree(java.lang.String fqn)
TreeCacheMarshaller.objectFromByteBuffer(byte[])
when
it receives a replication event for an Fqn that has been marked
as inactive. Currently a no-op.
inactivate(Fqn)
protected void fetchStateOnStartup() throws java.lang.Exception
java.lang.Exception
public Node get(java.lang.String fqn) throws CacheException
get
in interface TreeCacheMBean
fqn
- fqn String name to retrieve from cache
CacheException
public DataNode get(Fqn fqn, Option option) throws CacheException
Option
get
in interface TreeCacheMBean
fqn
- option
-
CacheException
public java.lang.Object get(Fqn fqn, java.lang.Object key, Option option) throws CacheException
Option
get
in interface TreeCacheMBean
fqn
- option
-
CacheException
public java.lang.Object get(Fqn fqn, java.lang.Object key, boolean sendNodeEvent, Option option) throws CacheException
Option
get
in interface TreeCacheMBean
fqn
- option
-
CacheException
public void remove(Fqn fqn, Option option) throws CacheException
Option
remove
in interface TreeCacheMBean
fqn
- option
-
CacheException
public java.lang.Object remove(Fqn fqn, java.lang.Object key, Option option) throws CacheException
Option
remove
in interface TreeCacheMBean
fqn
- key
- option
-
CacheException
public java.util.Set getChildrenNames(Fqn fqn, Option option) throws CacheException
Option
getChildrenNames
in interface TreeCacheMBean
fqn
- option
-
CacheException
public void put(Fqn fqn, java.util.Map data, Option option) throws CacheException
Option
put
in interface TreeCacheMBean
fqn
- data
- option
-
CacheException
public void put(Fqn fqn, java.lang.Object key, java.lang.Object value, Option option) throws CacheException
Option
put
in interface TreeCacheMBean
fqn
- key
- value
- option
-
CacheException
public Node get(Fqn fqn) throws CacheException
get
in interface TreeCacheMBean
fqn
- fqn instance to retrieve from cache
CacheException
public Node _get(Fqn fqn) throws CacheException
CacheException
public java.util.Map _getData(Fqn fqn)
public java.util.Set getKeys(java.lang.String fqn) throws CacheException
getKeys
in interface TreeCacheMBean
fqn
-
CacheException
public java.util.Set getKeys(Fqn fqn) throws CacheException
getKeys
in interface TreeCacheMBean
fqn
-
CacheException
public java.util.Set _getKeys(Fqn fqn) throws CacheException
CacheException
public java.lang.Object get(java.lang.String fqn, java.lang.Object key) throws CacheException
data
map. Returns null if the node was not found in the tree or the key was not found in the hashmap.
get
in interface TreeCacheMBean
fqn
- The fully qualified name of the node.key
- The key.
CacheException
public java.lang.Object get(Fqn fqn, java.lang.Object key) throws CacheException
data
map. Returns null if the node was not found in the tree or the key was not found in the hashmap.
get
in interface TreeCacheMBean
fqn
- The fully qualified name of the node.key
- The key.
CacheException
public java.lang.Object _get(Fqn fqn, java.lang.Object key, boolean sendNodeEvent) throws CacheException
CacheException
protected java.lang.Object get(Fqn fqn, java.lang.Object key, boolean sendNodeEvent) throws CacheException
CacheException
public java.lang.Object peek(Fqn fqn, java.lang.Object key) throws CacheException
get()
method but without triggering a node visit event. This is used
to prevent refresh of the cache data in the eviction policy.
fqn
- key
-
CacheException
public DataNode peek(Fqn fqn)
public boolean exists(java.lang.String fqn)
exists
in interface TreeCacheMBean
fqn
- The fully qualified name of the node
public boolean exists(Fqn fqn)
exists
in interface TreeCacheMBean
fqn
- The fully qualified name of the node
public boolean exists(java.lang.String fqn, java.lang.Object key)
exists
in interface TreeCacheMBean
fqn
- key
- public boolean exists(Fqn fqn, java.lang.Object key)
get(Fqn,Object)
exists
in interface TreeCacheMBean
fqn
- The fully qualified name of the nodekey
-
public void put(java.lang.String fqn, java.util.Map data) throws CacheException
put
in interface TreeCacheMBean
fqn
- The fully qualified name of the new nodedata
- The new data. May be null if no data should be set in the node.
CacheException
public void put(Fqn fqn, java.util.Map data) throws CacheException
put
in interface TreeCacheMBean
fqn
- The fully qualified name of the new nodedata
- The new data. May be null if no data should be set in the node.
CacheException
public java.lang.Object put(java.lang.String fqn, java.lang.Object key, java.lang.Object value) throws CacheException
put
in interface TreeCacheMBean
fqn
- The fully qualified name of the nodekey
- The keyvalue
- The value
CacheException
public java.lang.Object putFailFast(Fqn fqn, java.lang.Object key, java.lang.Object value, long timeout) throws CacheException
fqn
- The fully qualified name of the nodekey
- value
- timeout
- Number of milliseconds to wait until a lock has been acquired. A TimeoutException will
be thrown if not successful. 0 means to wait forever
CacheException
public java.lang.Object putFailFast(java.lang.String fqn, java.lang.Object key, java.lang.Object value, long timeout) throws CacheException
fqn
- key
- value
- timeout
-
CacheException
public java.lang.Object put(Fqn fqn, java.lang.Object key, java.lang.Object value) throws CacheException
put
in interface TreeCacheMBean
fqn
- The fully qualified name of the nodekey
- The keyvalue
- The value
CacheException
public void remove(java.lang.String fqn) throws CacheException
remove
in interface TreeCacheMBean
fqn
- The fully qualified name of the node.
CacheException
public void remove(Fqn fqn) throws CacheException
remove
in interface TreeCacheMBean
fqn
- The fully qualified name of the node.
CacheException
public void evict(Fqn fqn) throws CacheException
evict
in interface TreeCacheMBean
fqn
- Will remove everythign assoicated with this fqn.
CacheException
public java.lang.Object remove(java.lang.String fqn, java.lang.Object key) throws CacheException
key
from the node's hashmap
remove
in interface TreeCacheMBean
fqn
- The fullly qualified name of the nodekey
- The key to be removed
CacheException
public java.lang.Object remove(Fqn fqn, java.lang.Object key) throws CacheException
key
from the node's hashmap
remove
in interface TreeCacheMBean
fqn
- The fullly qualified name of the nodekey
- The key to be removed
CacheException
public void removeData(java.lang.String fqn) throws CacheException
removeData
in interface TreeCacheMBean
fqn
-
CacheException
public void removeData(Fqn fqn) throws CacheException
removeData
in interface TreeCacheMBean
fqn
-
CacheException
public void releaseAllLocks(java.lang.String fqn)
releaseAllLocks
in interface TreeCacheMBean
fqn
- public void releaseAllLocks(Fqn fqn)
releaseAllLocks
in interface TreeCacheMBean
fqn
- public java.lang.String print(java.lang.String fqn)
fqn
.
Output includes name, fqn and data.
print
in interface TreeCacheMBean
public java.lang.String print(Fqn fqn)
fqn
.
Output includes name, fqn and data.
print
in interface TreeCacheMBean
public java.util.Set getChildrenNames(java.lang.String fqn) throws CacheException
getChildrenNames
in interface TreeCacheMBean
fqn
- The fully qualified name of the node
CacheException
public java.util.Set getChildrenNames(Fqn fqn) throws CacheException
getChildrenNames
in interface TreeCacheMBean
fqn
- The fully qualified name of the node
CacheException
public java.util.Set _getChildrenNames(Fqn fqn) throws CacheException
CacheException
public boolean hasChild(Fqn fqn)
public java.lang.String toString()
toString
in interface TreeCacheMBean
toString
in class java.lang.Object
public java.lang.String toString(boolean details)
public java.lang.String printDetails()
printDetails
in interface TreeCacheMBean
public java.lang.String printLockInfo()
printLockInfo
in interface TreeCacheMBean
public int getNumberOfLocksHeld()
getNumberOfLocksHeld
in interface TreeCacheMBean
public int getNumberOfNodes()
getNumberOfNodes
in interface TreeCacheMBean
public int getNumberOfAttributes()
getNumberOfAttributes
in interface TreeCacheMBean
public int getNumberOfAttributes(Fqn fqn)
public java.util.List callRemoteMethods(java.util.Vector mbrs, org.jgroups.blocks.MethodCall method_call, boolean synchronous, boolean exclude_self, long timeout) throws java.lang.Exception
mbrs
- method_call
- synchronous
- exclude_self
- timeout
-
java.lang.Exception
public java.util.List callRemoteMethods(java.util.Vector mbrs, org.jgroups.blocks.MethodCall method_call, int mode, boolean exclude_self, long timeout) throws java.lang.Exception
mbrs
- method_call
- mode
- exclude_self
- timeout
-
java.lang.Exception
public 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
callRemoteMethods
in interface TreeCacheMBean
members
- method
- args
- synchronous
- exclude_self
- timeout
-
java.lang.Exception
public 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
callRemoteMethods
in interface TreeCacheMBean
members
- method_name
- types
- args
- synchronous
- exclude_self
- timeout
-
java.lang.Exception
public void _put(GlobalTransaction tx, java.lang.String fqn, java.util.Map data, boolean create_undo_ops) throws CacheException
TransactionEntry
's lock list, (b) add nodes
that were created to TransactionEntry
's node list and (c) create
Modification
s and add them to TransactionEntry
's modification
list and (d) create compensating modifications to undo the changes in case
of a rollback
_put
in interface TreeCacheMBean
fqn
- data
- create_undo_ops
- If true, undo operations will be created (default is true).
Otherwise they will not be created (used by rollback()).
CacheException
public void _put(GlobalTransaction tx, Fqn fqn, java.util.Map data, boolean create_undo_ops) throws CacheException
TransactionEntry
's lock list, (b) add nodes
that were created to TransactionEntry
's node list and (c) create
Modification
s and add them to TransactionEntry
's modification
list and (d) create compensating modifications to undo the changes in case
of a rollback
_put
in interface TreeCacheMBean
fqn
- data
- create_undo_ops
- If true, undo operations will be created (default is true).
Otherwise they will not be created (used by rollback()).
CacheException
public void _put(GlobalTransaction tx, Fqn fqn, java.util.Map data, boolean create_undo_ops, boolean erase_contents) throws CacheException
TransactionEntry
's lock list, (b) add nodes
that were created to TransactionEntry
's node list and (c) create
Modification
s and add them to TransactionEntry
's modification
list and (d) create compensating modifications to undo the changes in case
of a rollback
_put
in interface TreeCacheMBean
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()).
CacheException
public java.lang.Object _put(GlobalTransaction tx, java.lang.String fqn, java.lang.Object key, java.lang.Object value, boolean create_undo_ops) throws CacheException
_put
in interface TreeCacheMBean
fqn
- key
- value
-
CacheException
public java.lang.Object _put(GlobalTransaction tx, Fqn fqn, java.lang.Object key, java.lang.Object value, boolean create_undo_ops) throws CacheException
_put
in interface TreeCacheMBean
fqn
- key
- value
-
CacheException
public java.lang.Object _put(GlobalTransaction tx, Fqn fqn, java.lang.Object key, java.lang.Object value, boolean create_undo_ops, long timeout) throws CacheException
CacheException
public void _remove(GlobalTransaction tx, java.lang.String fqn, boolean create_undo_ops) throws CacheException
_remove
in interface TreeCacheMBean
fqn
-
CacheException
public void _remove(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops) throws CacheException
_remove
in interface TreeCacheMBean
fqn
-
CacheException
public void _remove(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent) throws CacheException
CacheException
public void _remove(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent, boolean eviction) throws CacheException
tx
- fqn
- create_undo_ops
- sendNodeEvent
-
CacheException
public void _remove(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent, boolean eviction, DataVersion version) throws CacheException
tx
- fqn
- create_undo_ops
- sendNodeEvent
- eviction
- version
-
CacheException
public java.lang.Object _remove(GlobalTransaction tx, java.lang.String fqn, java.lang.Object key, boolean create_undo_ops) throws CacheException
_remove
in interface TreeCacheMBean
fqn
- key
-
CacheException
public java.lang.Object _remove(GlobalTransaction tx, Fqn fqn, java.lang.Object key, boolean create_undo_ops) throws CacheException
_remove
in interface TreeCacheMBean
fqn
- key
-
CacheException
public void _removeData(GlobalTransaction tx, java.lang.String fqn, boolean create_undo_ops) throws CacheException
fqn
-
CacheException
public void _removeData(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops) throws CacheException
fqn
-
CacheException
public void _removeData(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent) throws CacheException
CacheException
public void _removeData(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent, boolean eviction) throws CacheException
CacheException
public void _removeData(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent, boolean eviction, DataVersion version) throws CacheException
CacheException
public void _evict(Fqn fqn) throws CacheException
fqn
- Will remove everything assoicated with this fqn.
CacheException
public void _evict(Fqn fqn, DataVersion version) throws CacheException
fqn
- version
-
CacheException
public void _addChild(GlobalTransaction tx, Fqn parent_fqn, java.lang.Object child_name, DataNode old_node) throws CacheException
_remove(GlobalTransaction,Fqn,boolean)
. This
is package-private on purpose because it is only supposed to be called inside
the same VM (by rollback(GlobalTransaction)
).
parent_fqn
- child_name
- old_node
-
CacheException
public java.lang.Object _replicate(org.jgroups.blocks.MethodCall method_call) throws java.lang.Throwable
method_call
-
java.lang.Throwable
public void _replicate(java.util.List method_calls) throws java.lang.Throwable
java.lang.Throwable
public java.util.List _clusteredGet(org.jgroups.blocks.MethodCall call)
call
-
public void _releaseAllLocks(Fqn fqn)
public java.lang.String _print(Fqn fqn)
public void _lock(Fqn fqn, int lock_type, boolean recursive) throws TimeoutException, LockingException
TimeoutException
LockingException
public void optimisticPrepare(GlobalTransaction gtx, java.util.List modifications, java.util.Map data, org.jgroups.Address address, boolean onePhaseCommit)
public void prepare(GlobalTransaction global_tx, java.util.List modifications, org.jgroups.Address coord, boolean onePhaseCommit)
public void commit(GlobalTransaction tx)
public void rollback(GlobalTransaction tx)
public void addUndoOperation(GlobalTransaction gtx, org.jgroups.blocks.MethodCall undo_op)
public CacheLoaderManager getCacheLoaderManager()
public void setCacheLoaderManager(CacheLoaderManager cacheLoaderManager)
public void viewAccepted(org.jgroups.View new_view)
viewAccepted
in interface org.jgroups.MembershipListener
public void suspect(org.jgroups.Address suspected_mbr)
suspect
in interface org.jgroups.MembershipListener
public void block()
block
in interface org.jgroups.MembershipListener
protected javax.transaction.Transaction getLocalTransaction()
getCurrentTransaction()
public GlobalTransaction getCurrentTransaction()
GlobalTransaction
. The mapping is maintained in the tx_map table.
If a local transaction exists, but doesn't yet have a mapping to a GlobalTransaction,
a new GlobalTransaction will be created and mapped to the local transaction.
Note that if a local transaction exists, but is not ACTIVE or PREPARING, null is returned too.
public GlobalTransaction getCurrentTransaction(boolean createIfNotExists)
public GlobalTransaction getCurrentTransaction(javax.transaction.Transaction tx)
public GlobalTransaction getCurrentTransaction(javax.transaction.Transaction tx, boolean createIfNotExists)
protected java.lang.Object invokeMethod(org.jgroups.blocks.MethodCall m) throws CacheException
m
-
CacheException
protected java.lang.Object getOwnerForLock()
protected java.lang.Class loadClass(java.lang.String classname) throws java.lang.ClassNotFoundException
null
(i.e. this class was loaded by the bootstrap classloader), the system classloader.
If loadtime instrumentation via GenerateInstrumentedClassLoader is used, this
class may be loaded by the bootstrap classloader.
java.lang.ClassNotFoundException
public RegionManager getRegionManager()
public RegionManager getEvictionRegionManager()
public void notifyNodeCreated(Fqn fqn)
public void notifyNodeLoaded(Fqn fqn)
public void notifyNodeActivate(Fqn fqn, boolean pre)
public void notifyNodePassivate(Fqn fqn, boolean pre)
protected void notifyNodeRemove(Fqn fqn, boolean pre)
protected void notifyNodeRemoved(Fqn fqn)
protected void notifyNodeEvict(Fqn fqn, boolean pre)
protected void notifyNodeEvicted(Fqn fqn)
protected void notifyNodeModify(Fqn fqn, boolean pre)
protected void notifyNodeModified(Fqn fqn)
protected void notifyNodeVisited(Fqn fqn)
protected void notifyCacheStarted()
protected void notifyCacheStopped()
protected void notifyViewChange(org.jgroups.View v)
protected void notifyAllNodesCreated(DataNode curr)
protected java.lang.String getDefaultProperties()
protected int string2Mode(java.lang.String mode)
public void setInvocationContext(InvocationContext invocationContext)
invocationContext
- public InvocationContext getInvocationContext()
public void setCacheLoaderClass(java.lang.String cache_loader_class)
setCacheLoaderClass
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoaderConfig(java.util.Properties cache_loader_config)
setCacheLoaderConfig
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoaderShared(boolean shared)
setCacheLoaderShared
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoaderPassivation(boolean passivate)
setCacheLoaderPassivation
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoaderPreload(java.lang.String list)
setCacheLoaderPreload
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoaderAsynchronous(boolean b)
setCacheLoaderAsynchronous
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoaderFetchPersistentState(boolean flag)
setCacheLoaderFetchPersistentState
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoaderFetchTransientState(boolean flag)
setCacheLoaderFetchTransientState
in interface TreeCacheMBean
{#setCacheLoaderConfig(Element e)}, the preferred way to configure cache loaders.
public void setCacheLoader(CacheLoader loader)
setCacheLoader
in interface TreeCacheMBean
loader
- public java.lang.String getCacheLoaderClass()
getCacheLoaderClass
in interface TreeCacheMBean
public boolean getCacheLoaderShared()
getCacheLoaderShared
in interface TreeCacheMBean
public boolean getCacheLoaderPassivation()
getCacheLoaderPassivation
in interface TreeCacheMBean
public boolean getCacheLoaderAsynchronous()
getCacheLoaderAsynchronous
in interface TreeCacheMBean
public java.lang.String getCacheLoaderPreload()
getCacheLoaderPreload
in interface TreeCacheMBean
public boolean getCacheLoaderFetchPersistentState()
getCacheLoaderFetchPersistentState
in interface TreeCacheMBean
public boolean getCacheLoaderFetchTransientState()
getCacheLoaderFetchTransientState
in interface TreeCacheMBean
public java.util.Properties getCacheLoaderConfig()
TreeCacheMBean
getCacheLoaderConfig
in interface TreeCacheMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |