|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.cache.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 | |
static Method |
addChildMethodLocal
|
protected CacheLoader |
cache_loader
A reference to the CacheLoader. |
protected String |
cache_loader_class
The fully qualified name of the CacheLoader (has to implement the CacheLoader interface) |
protected Properties |
cache_loader_config
The properties from which to configure the CacheLoader |
protected boolean |
cache_loader_fetch_persistent_state
Fetches the entire persistent state from the underlying CacheLoader. |
protected boolean |
cache_loader_fetch_transient_state
Fetches the transient state. |
protected List |
cache_loader_preload
List |
protected boolean |
cache_loader_shared
Are the CacheLoaders sharing the same resource or not ? |
protected int |
cache_mode
|
protected org.jgroups.JChannel |
channel
|
protected String |
cluster_name
|
protected String |
cluster_props
|
static Method |
commitMethod
|
protected boolean |
coordinator
Am I the coordinator ? |
protected org.jgroups.blocks.RpcDispatcher |
disp
|
protected Element |
evictConfig_
Eviction policy configuration in xml Element |
protected String |
eviction_policy_class
|
protected TreeCacheListener |
eviction_policy_provider
|
static Method |
evictKeyValueMethodLocal
|
static Method |
evictNodeMethodLocal
|
protected boolean |
fetch_state_on_startup
|
static Method |
getChildrenNamesMethodLocal
|
static Method |
getKeysMethodLocal
|
static Method |
getKeyValueMethodLocal
|
static Method |
getNodeMethodLocal
|
protected Interceptor |
interceptor_chain
invokeMethod(MethodCall) will dispatch to this chain of interceptors. |
protected IsolationLevel |
isolationLevel
|
protected boolean |
isStateSet
|
protected String |
jndi_name
|
protected Vector |
listeners
|
static int |
LOCAL
Entries in the cache are by default local; ie. |
protected long |
lock_acquisition_timeout
|
protected Vector |
members
|
protected org.jgroups.MessageListener |
ml
|
static Method |
prepareMethod
|
static Method |
printMethodLocal
|
protected Properties |
proxy_info
|
static Method |
putDataEraseMethodLocal
|
static Method |
putDataMethodLocal
|
static Method |
putKeyValMethodLocal
|
static Method |
releaseAllLocksMethodLocal
|
static Method |
removeDataMethodLocal
|
static Method |
removeKeyMethodLocal
|
static 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 Method |
replicateAllMethod
|
static Method |
replicateMethod
|
protected Replicatable |
replication_handler
Interceptor which handles invocations of _replicate(MethodCall) . |
static Method |
rollbackMethod
|
protected Node |
root
|
static String |
SEPARATOR
|
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 TransactionManager |
tm
Used to get the Transaction associated with the current thread |
protected TransactionManagerLookup |
tm_lookup
Method to acquire a TransactionManager. |
protected String |
tm_lookup_class
Class of the implementation of TransactionManagerLookup |
static String |
UNINITIALIZED
|
protected boolean |
use_repl_queue
|
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, 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(String cluster_name,
String props,
long state_fetch_timeout)
Creates a channel with the given properties. |
Method Summary | |
void |
_addChild(GlobalTransaction tx,
Fqn parent_fqn,
Object child_name,
Node old_node)
Compensating method to _remove(GlobalTransaction,Fqn,boolean) . |
void |
_evict(Fqn fqn)
Called by eviction policy provider. |
void |
_evict(Fqn fqn,
Object key)
Evicts a key/value pair from a node's attributes. |
Node |
_get(Fqn fqn)
|
Object |
_get(Fqn fqn,
Object key,
boolean sendNodeEvent)
|
Set |
_getChildrenNames(Fqn fqn)
|
Set |
_getKeys(Fqn fqn)
|
String |
_print(Fqn fqn)
|
void |
_put(GlobalTransaction tx,
Fqn fqn,
Map data,
boolean create_undo_ops)
Does the real work. |
void |
_put(GlobalTransaction tx,
Fqn fqn,
Map data,
boolean create_undo_ops,
boolean erase_contents)
Does the real work. |
Object |
_put(GlobalTransaction tx,
Fqn fqn,
Object key,
Object value,
boolean create_undo_ops)
|
void |
_put(GlobalTransaction tx,
String fqn,
Map data,
boolean create_undo_ops)
Does the real work. |
Object |
_put(GlobalTransaction tx,
String fqn,
Object key,
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 |
Object |
_remove(GlobalTransaction tx,
Fqn fqn,
Object key,
boolean create_undo_ops)
|
Object |
_remove(GlobalTransaction tx,
Fqn fqn,
Object key,
boolean create_undo_ops,
boolean sendNodeEvent)
|
void |
_remove(GlobalTransaction tx,
String fqn,
boolean create_undo_ops)
|
Object |
_remove(GlobalTransaction tx,
String fqn,
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,
String fqn,
boolean create_undo_ops)
|
void |
_replicate(List method_calls)
|
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. |
void |
addNode(GlobalTransaction gtx,
Fqn node)
|
void |
addTreeCacheListener(TreeCacheListener listener)
|
void |
block()
Block sending and receiving of messages until viewAccepted() is called |
List |
callRemoteMethods(Vector mbrs,
org.jgroups.blocks.MethodCall method_call,
boolean synchronous,
boolean exclude_self,
long timeout)
|
List |
callRemoteMethods(Vector members,
Method method,
Object[] args,
boolean synchronous,
boolean exclude_self,
long timeout)
|
List |
callRemoteMethods(Vector members,
String method_name,
Class[] types,
Object[] args,
boolean synchronous,
boolean exclude_self,
long timeout)
|
void |
commit(GlobalTransaction tx)
|
protected void |
createCacheLoader()
Creates an instance of a CacheLoader if and only if The CacheLoader has not yet been created cache_loader_class is set The CacheLoader is shared and we are not the coordinator (only the coordinator is supposed to have a CacheLoader) |
protected void |
createInterceptorChain()
Assembles the interceptor stack. |
void |
createService()
|
void |
destroyService()
|
protected boolean |
determineCoordinator()
|
String |
dumpTransactionTable()
Dumps the contents of the TransactionTable |
void |
evict(Fqn fqn)
Called by eviction policy provider. |
void |
evict(Fqn fqn,
Object key)
Evicts a key/value pair from a node's attributes. |
boolean |
exists(Fqn fqn)
Checks whether a given node exists in the tree. |
boolean |
exists(Fqn fqn,
Object key)
Checks whether a given key exists in the given node. |
boolean |
exists(String fqn)
Checks whether a given node exists in the tree |
boolean |
exists(String fqn,
Object key)
|
void |
fetchState(long timeout)
Fetch the group state from the current coordinator. |
protected void |
fetchStateOnStartup()
|
Node |
get(Fqn fqn)
|
Object |
get(Fqn fqn,
Object key)
Finds a node given its name and returns the value associated with a given key in its data
map. |
protected Object |
get(Fqn fqn,
Object key,
boolean sendNodeEvent)
|
Node |
get(String fqn)
|
Object |
get(String fqn,
Object key)
Finds a node given its name and returns the value associated with a given key in its data
map. |
CacheLoader |
getCacheLoader()
|
String |
getCacheLoaderClass()
|
Properties |
getCacheLoaderConfig()
|
boolean |
getCacheLoaderFetchPersistentState()
|
boolean |
getCacheLoaderFetchTransientState()
|
String |
getCacheLoaderPreload()
|
boolean |
getCacheLoaderShared()
|
String |
getCacheMode()
Returns the current caching mode. |
int |
getCacheModeInternal()
|
Set |
getChildrenNames(Fqn fqn)
Returns all children of a given node |
Set |
getChildrenNames(String fqn)
Returns all children of a given node |
String |
getClusterName()
Get the name of the replication group |
String |
getClusterProperties()
Get the cluster properties (e.g. |
GlobalTransaction |
getCurrentTransaction()
Get the transaction associated with the current thread and maps it onto a GlobalTransaction . |
GlobalTransaction |
getCurrentTransaction(Transaction tx)
|
protected String |
getDefaultProperties()
|
String |
getEvictionPolicyClass()
Returns the name of the cache eviction policy (must be an implementation of EvictionPolicy) |
Element |
getEvictionPolicyConfig()
|
int |
getEvictionThreadWakeupIntervalSeconds()
Obtain eviction thread (if any) wake up interval in seconds |
boolean |
getFetchStateOnStartup()
|
long |
getInitialStateRetrievalTimeout()
Get the max time to wait until the initial state is retrieved. |
TreeCache |
getInstance()
|
String |
getInterceptorChain()
|
List |
getInterceptors()
|
String |
getIsolationLevel()
Returns the transaction isolation level. |
IsolationLevel |
getIsolationLevelClass()
|
String |
getJndiName()
|
Set |
getKeys(Fqn fqn)
|
Set |
getKeys(String fqn)
|
Object |
getLocalAddress()
|
protected Transaction |
getLocalTransaction()
Returns the transaction associated with the current thread. |
long |
getLockAcquisitionTimeout()
Default max time to wait for a lock. |
Vector |
getMembers()
|
org.jgroups.MessageListener |
getMessageListener()
|
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. |
Properties |
getRemoteProxy()
|
Replicatable |
getReplicationHandler()
|
ReplicationQueue |
getReplQueue()
|
long |
getReplQueueInterval()
|
int |
getReplQueueMaxElements()
|
Node |
getRoot()
Used by interceptors. |
boolean |
getSyncCommitPhase()
|
long |
getSyncReplTimeout()
Returns the default max timeout after which synchronous replication calls return. |
boolean |
getSyncRollbackPhase()
|
TransactionManager |
getTransactionManager()
|
String |
getTransactionManagerLookupClass()
|
TransactionTable |
getTransactionTable()
|
boolean |
getUseReplQueue()
|
boolean |
hasChild(Fqn fqn)
|
protected Object |
invokeMethod(org.jgroups.blocks.MethodCall m)
Invokes a method against this object. |
boolean |
isCoordinator()
|
static boolean |
isCrudMethod(Method m)
|
void |
load(String fqn)
Loads the indicated Fqn, plus all parents recursively from the CacheLoader. |
void |
lock(Fqn fqn,
Object owner,
int lock_type,
boolean lock_recursive)
Lock a given node (or the entire subtree starting at this node) |
protected void |
notifyAllNodesCreated(Node curr)
Generates NodeAdded notifications for all nodes of the tree. |
protected void |
notifyCacheStarted()
|
protected void |
notifyCacheStopped()
|
void |
notifyNodeCreated(Fqn fqn)
|
protected void |
notifyNodeEvicted(Fqn fqn)
|
void |
notifyNodeLoaded(Fqn fqn)
|
protected void |
notifyNodeModified(Fqn fqn)
|
protected void |
notifyNodeRemoved(Fqn fqn)
|
protected void |
notifyNodeVisisted(Fqn fqn)
|
protected void |
notifyViewChange(org.jgroups.View v)
|
Object |
peek(Fqn fqn,
Object key)
Like get() method but without triggering a node visit event. |
void |
prepare(GlobalTransaction global_tx,
List modifications,
org.jgroups.Address coord,
boolean commit)
|
String |
print(Fqn fqn)
Prints a representation of the node defined by fqn . |
String |
print(String fqn)
Prints a representation of the node defined by fqn . |
String |
printDetails()
|
String |
printLockInfo()
|
void |
put(Fqn fqn,
Map data)
Adds a new node to the tree and sets its data. |
Object |
put(Fqn fqn,
Object key,
Object value)
Adds a key and value to a given node. |
void |
put(String fqn,
Map data)
Adds a new node to the tree and sets its data. |
Object |
put(String fqn,
Object key,
Object value)
Adds a key and value to a given node. |
void |
releaseAllLocks(Fqn fqn)
Force-releases all locks in this node and the entire subtree |
void |
releaseAllLocks(String fqn)
Force-releases all locks in this node and the entire subtree |
void |
remove(Fqn fqn)
Removes the node from the tree. |
Object |
remove(Fqn fqn,
Object key)
Removes key from the node's hashmap |
void |
remove(String fqn)
Removes the node from the tree. |
Object |
remove(String fqn,
Object key)
Removes key from the node's hashmap |
void |
removeData(Fqn fqn)
|
void |
removeData(String fqn)
|
void |
removeTreeCacheListener(TreeCacheListener listener)
|
void |
rollback(GlobalTransaction tx)
|
void |
setCacheLoader(CacheLoader cache_loader)
|
void |
setCacheLoaderClass(String cache_loader_class)
|
void |
setCacheLoaderConfig(Properties cache_loader_config)
|
void |
setCacheLoaderFetchPersistentState(boolean flag)
|
void |
setCacheLoaderFetchTransientState(boolean flag)
|
void |
setCacheLoaderPreload(String list)
|
void |
setCacheLoaderShared(boolean shared)
|
void |
setCacheMode(int mode)
Sets the default cache mode. |
void |
setCacheMode(String mode)
Sets the default caching mode) |
void |
setClusterConfig(Element config)
Convert a list of elements to the JG property string |
void |
setClusterName(String name)
Set the name of the replication group |
void |
setClusterProperties(String cluster_props)
Set the cluster properties. |
void |
setEvictionPolicyClass(String eviction_policy_class)
Sets the classname of the eviction policy |
void |
setEvictionPolicyConfig(Element config)
Setup eviction policy configuration |
void |
setFetchStateOnStartup(boolean flag)
|
void |
setInitialStateRetrievalTimeout(long timeout)
Set the initial state transfer timeout (see getInitialStateRetrievalTimeout() ) |
void |
setIsolationLevel(IsolationLevel level)
|
void |
setIsolationLevel(String level)
Set the transaction isolation level. |
void |
setJndiName(String jndi_name)
|
void |
setLockAcquisitionTimeout(long timeout)
Set the max time for lock acquisition. |
void |
setRemoteProxy(Properties info)
|
void |
setReplicationHandler(Replicatable handler)
|
void |
setReplQueueInterval(long interval)
|
void |
setReplQueueMaxElements(int max_elements)
|
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(String cl)
Sets the class of the TransactionManagerLookup impl. |
void |
setUseReplQueue(boolean flag)
|
protected void |
startCacheLoader()
|
void |
startService()
|
void |
stopService()
|
protected int |
string2Mode(String mode)
|
void |
suspect(org.jgroups.Address suspected_mbr)
Called when a member is suspected |
String |
toString()
|
void |
unlock(Fqn fqn,
Object owner,
boolean unlock_recursive,
boolean force)
Unlock a given node (or the entire subtree starting at this node) |
void |
viewAccepted(org.jgroups.View new_view)
|
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
create, destroy, 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, 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 |
protected Node root
protected final Vector listeners
protected org.jgroups.JChannel channel
protected boolean coordinator
protected String cluster_name
protected String cluster_props
protected final Vector members
protected org.jgroups.blocks.RpcDispatcher disp
protected org.jgroups.MessageListener ml
protected long state_fetch_timeout
protected long sync_repl_timeout
protected boolean use_repl_queue
protected int repl_queue_max_elements
protected long repl_queue_interval
protected boolean fetch_state_on_startup
protected long lock_acquisition_timeout
protected String eviction_policy_class
protected TreeCacheListener eviction_policy_provider
protected int cache_mode
public static Method putDataMethodLocal
public static Method putDataEraseMethodLocal
public static Method putKeyValMethodLocal
public static Method removeNodeMethodLocal
public static Method removeKeyMethodLocal
public static Method removeDataMethodLocal
public static Method evictNodeMethodLocal
public static Method evictKeyValueMethodLocal
public static Method prepareMethod
public static Method commitMethod
public static Method rollbackMethod
public static Method replicateMethod
public static Method replicateAllMethod
public static Method addChildMethodLocal
public static Method getKeyValueMethodLocal
public static Method getNodeMethodLocal
public static Method getKeysMethodLocal
public static Method getChildrenNamesMethodLocal
public static Method releaseAllLocksMethodLocal
public static Method printMethodLocal
protected boolean isStateSet
protected IsolationLevel isolationLevel
protected Element evictConfig_
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 Replicatable replication_handler
_replicate(MethodCall)
. Any such method
invocation is forwarded to the invoke_handler.
protected TransactionManagerLookup tm_lookup
ServiceMBeanSupport.start()
protected String tm_lookup_class
protected TransactionManager tm
protected String cache_loader_class
protected CacheLoader cache_loader
protected Properties cache_loader_config
protected boolean cache_loader_shared
protected List cache_loader_preload
protected boolean cache_loader_fetch_transient_state
protected boolean cache_loader_fetch_persistent_state
protected boolean sync_commit_phase
protected boolean sync_rollback_phase
protected String jndi_name
protected Properties proxy_info
protected ReplicationQueue repl_queue
public static final String SEPARATOR
public static final int LOCAL
public static final int REPL_ASYNC
public static final int REPL_SYNC
public static final String UNINITIALIZED
Constructor Detail |
public TreeCache(String cluster_name, String props, long state_fetch_timeout) throws Exception
public TreeCache() throws Exception
public TreeCache(org.jgroups.JChannel channel) throws Exception
Method Detail |
public org.jgroups.MessageListener getMessageListener()
public static boolean isCrudMethod(Method m)
public Node getRoot()
public Object getLocalAddress()
getLocalAddress
in interface TreeCacheMBean
public Vector getMembers()
getMembers
in interface TreeCacheMBean
public boolean isCoordinator()
isCoordinator
in interface TreeCacheMBean
public String getClusterName()
getClusterName
in interface TreeCacheMBean
public void setClusterName(String name)
setClusterName
in interface TreeCacheMBean
public String getClusterProperties()
getClusterProperties
in interface TreeCacheMBean
public void setClusterProperties(String cluster_props)
setClusterProperties
in interface TreeCacheMBean
cluster_props
- The properties for the cluster (JGroups)public TransactionTable getTransactionTable()
public String dumpTransactionTable()
dumpTransactionTable
in interface TreeCacheMBean
public String getInterceptorChain()
getInterceptorChain
in interface TreeCacheMBean
public List getInterceptors()
getInterceptors
in interface TreeCacheMBean
public String getCacheLoaderClass()
getCacheLoaderClass
in interface TreeCacheMBean
public void setCacheLoaderClass(String cache_loader_class)
setCacheLoaderClass
in interface TreeCacheMBean
cache_loader_class
- public Properties getCacheLoaderConfig()
getCacheLoaderConfig
in interface TreeCacheMBean
public void setCacheLoaderConfig(Properties cache_loader_config)
setCacheLoaderConfig
in interface TreeCacheMBean
cache_loader_config
- public CacheLoader getCacheLoader()
getCacheLoader
in interface TreeCacheMBean
public void setCacheLoader(CacheLoader cache_loader)
setCacheLoader
in interface TreeCacheMBean
cache_loader
- public boolean getCacheLoaderShared()
getCacheLoaderShared
in interface TreeCacheMBean
public void setCacheLoaderShared(boolean shared)
setCacheLoaderShared
in interface TreeCacheMBean
shared
- public void setCacheLoaderPreload(String list)
setCacheLoaderPreload
in interface TreeCacheMBean
list
- public String getCacheLoaderPreload()
getCacheLoaderPreload
in interface TreeCacheMBean
public void setCacheLoaderFetchPersistentState(boolean flag)
setCacheLoaderFetchPersistentState
in interface TreeCacheMBean
flag
- public boolean getCacheLoaderFetchPersistentState()
getCacheLoaderFetchPersistentState
in interface TreeCacheMBean
public void setCacheLoaderFetchTransientState(boolean flag)
setCacheLoaderFetchTransientState
in interface TreeCacheMBean
flag
- public boolean getCacheLoaderFetchTransientState()
getCacheLoaderFetchTransientState
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(Element config)
setEvictionPolicyConfig
in interface TreeCacheMBean
public Element getEvictionPolicyConfig()
public void setClusterConfig(Element config)
setClusterConfig
in interface TreeCacheMBean
public long getInitialStateRetrievalTimeout()
getInitialStateRetrievalTimeout
in interface TreeCacheMBean
public void setInitialStateRetrievalTimeout(long timeout)
getInitialStateRetrievalTimeout()
)
setInitialStateRetrievalTimeout
in interface TreeCacheMBean
public String getCacheMode()
getCacheMode
in interface TreeCacheMBean
public int getCacheModeInternal()
public void setCacheMode(String mode) throws Exception
setCacheMode
in interface TreeCacheMBean
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 String getIsolationLevel()
getIsolationLevel
in interface TreeCacheMBean
public void setIsolationLevel(String level)
setIsolationLevel
in interface TreeCacheMBean
public void setIsolationLevel(IsolationLevel level)
level
- public IsolationLevel getIsolationLevelClass()
public boolean getFetchStateOnStartup()
getFetchStateOnStartup
in interface TreeCacheMBean
public void setFetchStateOnStartup(boolean flag)
setFetchStateOnStartup
in interface TreeCacheMBean
flag
- public long getLockAcquisitionTimeout()
getLockAcquisitionTimeout
in interface TreeCacheMBean
public void setLockAcquisitionTimeout(long timeout)
setLockAcquisitionTimeout
in interface TreeCacheMBean
timeout
- public String getEvictionPolicyClass()
getEvictionPolicyClass
in interface TreeCacheMBean
public void setEvictionPolicyClass(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 String getTransactionManagerLookupClass()
getTransactionManagerLookupClass
in interface TreeCacheMBean
public void setTransactionManagerLookupClass(String cl) throws Exception
setTransactionManagerLookupClass
in interface TreeCacheMBean
cl
-
Exception
public TransactionManager getTransactionManager()
getTransactionManager
in interface TreeCacheMBean
public TreeCache getInstance()
getInstance
in interface TreeCacheMBean
public String getJndiName()
getJndiName
in interface TreeCacheMBean
public void setJndiName(String jndi_name) throws Exception
setJndiName
in interface TreeCacheMBean
jndi_name
- properties
Exception
public Properties getRemoteProxy()
getRemoteProxy
in interface TreeCacheMBean
public void setRemoteProxy(Properties info) throws Exception
setRemoteProxy
in interface TreeCacheMBean
info
- properties
Exception
public void setReplicationHandler(Replicatable handler)
public Replicatable getReplicationHandler()
public void fetchState(long timeout) throws org.jgroups.ChannelClosedException, org.jgroups.ChannelNotConnectedException
fetchState
in interface TreeCacheMBean
org.jgroups.ChannelClosedException
org.jgroups.ChannelNotConnectedException
public void addTreeCacheListener(TreeCacheListener listener)
addTreeCacheListener
in interface TreeCacheMBean
listener
- public void removeTreeCacheListener(TreeCacheListener listener)
removeTreeCacheListener
in interface TreeCacheMBean
listener
- public void createService() throws Exception
createService
in interface TreeCacheMBean
Exception
public void destroyService()
destroyService
in interface TreeCacheMBean
public void startService() throws Exception
startService
in interface TreeCacheMBean
Exception
protected void createInterceptorChain() throws IllegalAccessException, InstantiationException, ClassNotFoundException
CallInterceptor LockInterceptor CreateIfNotExistsInterceptor [CacheLoaderInterceptor] [ReplicationInterceptor] [CacheStoreInterceptor] or CallInterceptor LockInterceptor CreateIfNotExistsInterceptor [CacheStoreInterceptor] [CacheLoaderInterceptor] [ReplicationInterceptor]CallInterceptor is always present at the top, the others may or may not be present
protected void createCacheLoader() throws Exception
Exception
protected void startCacheLoader() throws Exception
Exception
public void load(String fqn) throws Exception
load
in interface TreeCacheMBean
fqn
-
Exception
protected boolean determineCoordinator()
protected void fetchStateOnStartup() throws Exception
Exception
public void stopService()
stopService
in interface TreeCacheMBean
public Node get(String fqn) throws CacheException
fqn
- fqn String name to retrieve from cache
CacheException
public Node get(Fqn fqn) throws CacheException
fqn
- fqn instance to retrieve from cache
CacheException
public Node _get(Fqn fqn) throws CacheException
CacheException
public Set getKeys(String fqn) throws CacheException
getKeys
in interface TreeCacheMBean
fqn
-
CacheException
public Set getKeys(Fqn fqn) throws CacheException
getKeys
in interface TreeCacheMBean
fqn
-
CacheException
public Set _getKeys(Fqn fqn) throws CacheException
CacheException
public Object get(String fqn, 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 Object get(Fqn fqn, 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 Object _get(Fqn fqn, Object key, boolean sendNodeEvent) throws CacheException
CacheException
protected Object get(Fqn fqn, Object key, boolean sendNodeEvent) throws CacheException
CacheException
public Object peek(Fqn fqn, 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 boolean exists(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(String fqn, Object key)
exists
in interface TreeCacheMBean
fqn
- key
-
public boolean exists(Fqn fqn, Object key)
get(Fqn,Object)
exists
in interface TreeCacheMBean
fqn
- The fully qualified name of the nodekey
-
public void put(String fqn, 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, 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 Object put(String fqn, Object key, Object value) throws CacheException
put
in interface TreeCacheMBean
fqn
- The fully qualified name of the nodekey
- The keyvalue
- The value
CacheException
public Object put(Fqn fqn, Object key, Object value) throws CacheException
put
in interface TreeCacheMBean
fqn
- The fully qualified name of the nodekey
- The keyvalue
- The value
CacheException
public void remove(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 void evict(Fqn fqn, Object key) throws CacheException
evict
in interface TreeCacheMBean
fqn
- key
-
CacheException
public Object remove(String fqn, 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 Object remove(Fqn fqn, 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(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 lock(Fqn fqn, Object owner, int lock_type, boolean lock_recursive) throws CacheException
fqn
- The FQN of the nodeowner
- The owner. This is simply a key into a hashtable, and can be anything, e.g.
a GlobalTransaction, the current thread, or a special object. If null, it is set to Thread.currentThread()lock_type
- The type of lock (RO, RW). Needs to be of type Node.LOCK_TYPE_READ or Node.LOCK_TYPE_WRITElock_recursive
- If true, the entire subtree is locked, else only the given node
CacheException
- If node doesn't exist, a NodeNotExistsException is throw. Other exceptions are
LockingException, TimeoutException and UpgradeExceptionpublic void unlock(Fqn fqn, Object owner, boolean unlock_recursive, boolean force)
fqn
- The FQN of the nodeowner
- The owner. This is simply a key into a hashtable, and can be anything, e.g.
a GlobalTransaction, the current thread, or a special object. If null, it is set to Thread.currentThread()unlock_recursive
- If true, the entire subtree is unlocked, else only the given nodeforce
- Release the lock even if we're not the ownerpublic void releaseAllLocks(String fqn)
releaseAllLocks
in interface TreeCacheMBean
fqn
- public void releaseAllLocks(Fqn fqn)
releaseAllLocks
in interface TreeCacheMBean
fqn
- public String print(String fqn)
fqn
.
Output includes name, fqn and data.
print
in interface TreeCacheMBean
public String print(Fqn fqn)
fqn
.
Output includes name, fqn and data.
print
in interface TreeCacheMBean
public Set getChildrenNames(String fqn) throws CacheException
getChildrenNames
in interface TreeCacheMBean
fqn
- The fully qualified name of the node
CacheException
public Set getChildrenNames(Fqn fqn) throws CacheException
getChildrenNames
in interface TreeCacheMBean
fqn
- The fully qualified name of the node
CacheException
public Set _getChildrenNames(Fqn fqn) throws CacheException
CacheException
public boolean hasChild(Fqn fqn)
public String toString()
toString
in interface TreeCacheMBean
public String printDetails()
printDetails
in interface TreeCacheMBean
public 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 List callRemoteMethods(Vector mbrs, org.jgroups.blocks.MethodCall method_call, boolean synchronous, boolean exclude_self, long timeout) throws Exception
Exception
public List callRemoteMethods(Vector members, Method method, Object[] args, boolean synchronous, boolean exclude_self, long timeout) throws Exception
callRemoteMethods
in interface TreeCacheMBean
members
- method
- args
- synchronous
- exclude_self
- timeout
-
Exception
public List callRemoteMethods(Vector members, String method_name, Class[] types, Object[] args, boolean synchronous, boolean exclude_self, long timeout) throws Exception
callRemoteMethods
in interface TreeCacheMBean
members
- method_name
- types
- args
- synchronous
- exclude_self
- timeout
-
Exception
public void _put(GlobalTransaction tx, String fqn, 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, 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, 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 Object _put(GlobalTransaction tx, String fqn, Object key, Object value, boolean create_undo_ops) throws CacheException
_put
in interface TreeCacheMBean
fqn
- key
- value
-
CacheException
public Object _put(GlobalTransaction tx, Fqn fqn, Object key, Object value, boolean create_undo_ops) throws CacheException
_put
in interface TreeCacheMBean
fqn
- key
- value
-
CacheException
public void _remove(GlobalTransaction tx, 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 Object _remove(GlobalTransaction tx, String fqn, Object key, boolean create_undo_ops) throws CacheException
_remove
in interface TreeCacheMBean
fqn
- key
-
CacheException
public Object _remove(GlobalTransaction tx, Fqn fqn, Object key, boolean create_undo_ops) throws CacheException
_remove
in interface TreeCacheMBean
fqn
- key
-
CacheException
public Object _remove(GlobalTransaction tx, Fqn fqn, Object key, boolean create_undo_ops, boolean sendNodeEvent) throws CacheException
CacheException
public void _removeData(GlobalTransaction tx, 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 _evict(Fqn fqn) throws CacheException
fqn
- Will remove everythign assoicated with this fqn.
CacheException
public void _evict(Fqn fqn, Object key) throws CacheException
fqn
- key
-
CacheException
public void _addChild(GlobalTransaction tx, Fqn parent_fqn, Object child_name, Node 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 Object _replicate(org.jgroups.blocks.MethodCall method_call) throws Throwable
method_call
-
Throwable
public void _replicate(List method_calls) throws Throwable
Throwable
public void _releaseAllLocks(Fqn fqn)
public String _print(Fqn fqn)
public void prepare(GlobalTransaction global_tx, List modifications, org.jgroups.Address coord, boolean commit)
public void commit(GlobalTransaction tx)
public void rollback(GlobalTransaction tx)
public void addNode(GlobalTransaction gtx, Fqn node)
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 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(Transaction tx)
protected Object invokeMethod(org.jgroups.blocks.MethodCall m) throws CacheException
m
-
CacheException
public void notifyNodeCreated(Fqn fqn)
public void notifyNodeLoaded(Fqn fqn)
protected void notifyNodeRemoved(Fqn fqn)
protected void notifyNodeEvicted(Fqn fqn)
protected void notifyNodeModified(Fqn fqn)
protected void notifyNodeVisisted(Fqn fqn)
protected void notifyCacheStarted()
protected void notifyCacheStopped()
protected void notifyViewChange(org.jgroups.View v)
protected void notifyAllNodesCreated(Node curr)
protected String getDefaultProperties()
protected int string2Mode(String mode)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |