|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TreeNode
Represents a node in the tree. Has a relative name and a Fqn. Maintains a hashmap of general data. If the node is created in a replicated cache, the relative and fully qualified name, and the keys and values of the hashmap must be serializable.
The current version supports different levels of transaction locking such as
simple locking (IsolationLevel.SERIALIZABLE
, or Read/Write lock with
upgrade ( IsolationLevel.REPEATABLE_READ
) --that is the read lock will be
automatically upgraded to write lock when the same owner intends to modify
the data after read.
Implementations may not necessarily be not synchronized, so access to instances of TreeNode need to be run under an isolation level above NONE.
Method Summary | |
---|---|
java.util.Set |
acquireAll(java.lang.Object caller,
long timeout,
int lock_type)
Deprecated. Will be removed in JBossCache 1.3. |
void |
addChild(java.lang.Object child_name,
TreeNode n)
Adds the already created child node. |
boolean |
childExists(java.lang.Object child_name)
Returns true if the child exists. |
void |
clear()
Clears the data of this node. |
boolean |
containsKey(java.lang.Object key)
Returns true if the key is in the data set. |
TreeNode |
createChild(java.lang.Object child_name,
Fqn fqn,
TreeNode parent)
Creates a child node with a name, FQN, and parent. |
TreeNode |
createChild(java.lang.Object child_name,
Fqn fqn,
TreeNode parent,
java.lang.Object key,
java.lang.Object value)
Creates a child node. |
java.lang.Object |
get(java.lang.Object key)
Returns the value of a key or null if it does not exist. |
TreeNode |
getChild(java.lang.Object childName)
Returns the named child of this node. |
java.util.Map |
getChildren()
Returns an unmodifiable map, mapping keys to child nodes. |
boolean |
getChildrenLoaded()
Deprecated. Will be removed in JBossCache 1.3. |
java.util.Map |
getData()
Deprecated. Will be removed in JBossCache 1.3. |
java.util.Set |
getDataKeys()
Returns the data keys, or an empty set if there are no keys. |
Fqn |
getFqn()
Returns the fully qualified name of the node. |
IdentityLock |
getImmutableLock()
Deprecated. Will be removed in JBossCache 1.3. |
IdentityLock |
getLock()
Deprecated. Will be removed in JBossCache 1.3. |
java.lang.Object |
getName()
Returns the name of this node. |
TreeNode |
getOrCreateChild(java.lang.Object child_name,
GlobalTransaction gtx,
boolean createIfNotExists)
Creates a new child of this node if it doesn't exist. |
TreeNode |
getParent()
Returns the parent of this node. |
boolean |
hasChildren()
Returns true if this node has children. |
boolean |
isLocked()
Deprecated. Will be removed in JBossCache 1.3. |
int |
numAttributes()
Returns the number of attributes. |
void |
print(java.lang.StringBuffer sb,
int indent)
Prints the node and children. |
void |
printDetails(java.lang.StringBuffer sb,
int indent)
Prints the node with details and indent. |
void |
printIndent(java.lang.StringBuffer sb,
int indent)
Prints the node with indent. |
void |
printLockInfo(java.lang.StringBuffer sb,
int indent)
Deprecated. Will be removed in JBossCache 1.3. |
void |
put(java.util.Map data)
Adds (merges) the contents of the map with the existing data. |
void |
put(java.util.Map data,
boolean eraseData)
Puts the contents of a map into this node. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts the key and value into the node. |
void |
release(java.lang.Object caller)
Deprecated. Will be removed in JBossCache 1.3. |
void |
releaseAll(java.lang.Object owner)
Deprecated. Will be removed in JBossCache 1.3. |
void |
releaseAllForce()
Deprecated. Will be removed in JBossCache 1.3. |
void |
releaseForce()
Deprecated. Will be removed in JBossCache 1.3. |
java.lang.Object |
remove(java.lang.Object key)
Removes the old value of the key. |
void |
removeAllChildren()
Removes all children. |
void |
removeChild(java.lang.Object childName)
Removes the named child of this node. |
void |
setChildren(java.util.Map children)
Deprecated. Will be removed in JBossCache 1.3. |
void |
setChildrenLoaded(boolean b)
Deprecated. Will be removed in JBossCache 1.3. |
void |
setRecursiveTreeCacheInstance(TreeCache cache)
Deprecated. Will be removed in JBossCache 1.3. |
Method Detail |
---|
TreeNode createChild(java.lang.Object child_name, Fqn fqn, TreeNode parent)
Fqn getFqn()
TreeNode getChild(java.lang.Object childName)
void removeChild(java.lang.Object childName)
TreeNode getParent()
void put(java.util.Map data, boolean eraseData)
eraseData
- true to erase the existing contentsjava.lang.Object put(java.lang.Object key, java.lang.Object value)
java.lang.Object remove(java.lang.Object key)
java.lang.Object get(java.lang.Object key)
void clear()
void put(java.util.Map data)
java.lang.Object getName()
void print(java.lang.StringBuffer sb, int indent)
void printDetails(java.lang.StringBuffer sb, int indent)
void printIndent(java.lang.StringBuffer sb, int indent)
boolean containsKey(java.lang.Object key)
java.util.Map getChildren()
java.util.Set getDataKeys()
boolean childExists(java.lang.Object child_name)
int numAttributes()
boolean hasChildren()
TreeNode createChild(java.lang.Object child_name, Fqn fqn, TreeNode parent, java.lang.Object key, java.lang.Object value)
void removeAllChildren()
void addChild(java.lang.Object child_name, TreeNode n)
java.util.Map getData()
DataNode
IdentityLock getImmutableLock()
DataNode
IdentityLock getLock()
DataNode
TreeNode getOrCreateChild(java.lang.Object child_name, GlobalTransaction gtx, boolean createIfNotExists)
DataNode
void printLockInfo(java.lang.StringBuffer sb, int indent)
DataNode
boolean isLocked()
DataNode
void releaseAll(java.lang.Object owner)
DataNode
void releaseAllForce()
DataNode
java.util.Set acquireAll(java.lang.Object caller, long timeout, int lock_type) throws LockingException, TimeoutException, java.lang.InterruptedException
LockingException
TimeoutException
java.lang.InterruptedException
DataNode
void setRecursiveTreeCacheInstance(TreeCache cache)
DataNode
boolean getChildrenLoaded()
DataNode
void setChildrenLoaded(boolean b)
DataNode
void setChildren(java.util.Map children)
void release(java.lang.Object caller)
DataNode
void releaseForce()
DataNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |