|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.AbstractNode
org.jboss.cache.Node
public class Node
Basic data node class.
| Field Summary |
|---|
| Fields inherited from class org.jboss.cache.AbstractNode |
|---|
children, data, fqn, INDENT |
| Fields inherited from interface org.jboss.cache.DataNode |
|---|
LOCK_TYPE_NONE, LOCK_TYPE_READ, LOCK_TYPE_WRITE, PRINT_LOCK_DETAILS |
| Constructor Summary | |
|---|---|
Node()
Construct an empty node; used by serialization. |
|
Node(java.lang.Object child_name,
Fqn fqn,
Node parent,
java.util.Map data,
boolean mapSafe,
TreeCache cache)
Constructs a new node with a name, etc. |
|
Node(java.lang.Object child_name,
Fqn fqn,
Node parent,
java.util.Map data,
TreeCache cache)
Constructs a new node with a name, etc. |
|
Node(java.lang.Object child_name,
Fqn fqn,
Node parent,
java.lang.Object key,
java.lang.Object value,
TreeCache cache)
Constructs a new node with a single key and value. |
|
| Method Summary | |
|---|---|
boolean |
acquire(java.lang.Object caller,
long timeout,
int lock_type)
Returns true if a lock is acquired. |
java.util.Set |
acquireAll(java.lang.Object caller,
long timeout,
int lock_type)
Not to be exposed. |
protected boolean |
acquireReadLock(java.lang.Object caller,
long timeout)
|
protected boolean |
acquireWriteLock(java.lang.Object caller,
long timeout)
|
protected java.util.Map |
children()
Override this if concurrent thread access may occur, in which case return a concurrently modifiable Map. |
void |
clear()
Clears the data of this node. |
java.lang.Object |
clone()
Returns a copy 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. |
boolean |
getChildrenLoaded()
Not to be exposed. |
java.util.Map |
getData()
Returns a copy of the attributes. |
java.util.Set |
getDataKeys()
Returns the data keys, or an empty set if there are no keys. |
IdentityLock |
getImmutableLock()
Deprecated. Use getLock() instead |
IdentityLock |
getLock()
Not to be exposed. |
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 a parent by checking the TreeMap by name. |
protected void |
init(java.lang.Object child_name,
Fqn fqn,
TreeCache cache)
Initializes with a name and FQN and cache. |
boolean |
isLocked()
Not to be exposed. |
int |
numAttributes()
Returns the number of attributes. |
void |
printDetails(java.lang.StringBuffer sb,
int indent)
Prints the node with details and indent. |
void |
printLockInfo(java.lang.StringBuffer sb,
int indent)
Not to be exposed. |
void |
put(java.util.Map data,
boolean erase)
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 |
readExternal(java.io.ObjectInput in)
Deserializes this object from ObjectInput. |
void |
release(java.lang.Object caller)
Not to be exposed. |
void |
releaseAll(java.lang.Object owner)
Not to be exposed. |
void |
releaseAllForce()
Not to be exposed. |
void |
releaseForce()
Not to be exposed. |
java.lang.Object |
remove(java.lang.Object key)
Removes the old value of the key. |
void |
setChildrenLoaded(boolean flag)
Not to be exposed. |
void |
setRecursiveTreeCacheInstance(TreeCache cache)
Set the tree cache instance recursively down to the children as well. |
java.lang.String |
toString()
Returns a debug string. |
void |
writeExternal(java.io.ObjectOutput out)
Serializes this object to ObjectOutput. |
| Methods inherited from class org.jboss.cache.AbstractNode |
|---|
addChild, childExists, data, getChild, getChildren, getFqn, getName, hasChildren, print, printDetailsInMap, printIndent, put, removeAllChildren, removeChild, setChildren |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Node()
public Node(java.lang.Object child_name,
Fqn fqn,
Node parent,
java.util.Map data,
TreeCache cache)
public Node(java.lang.Object child_name,
Fqn fqn,
Node parent,
java.util.Map data,
boolean mapSafe,
TreeCache cache)
mapSafe - true if param data can safely be
directly assigned to this object's AbstractNode.data field;
false if param data's contents
should be copied into this object's AbstractNode.data field.
public Node(java.lang.Object child_name,
Fqn fqn,
Node parent,
java.lang.Object key,
java.lang.Object value,
TreeCache cache)
| Method Detail |
|---|
protected final void init(java.lang.Object child_name,
Fqn fqn,
TreeCache cache)
public TreeNode getParent()
getParent in interface TreeNodegetParent in class AbstractNodeprotected java.util.Map children()
AbstractNode
children in class AbstractNodepublic void setRecursiveTreeCacheInstance(TreeCache cache)
setRecursiveTreeCacheInstance in interface TreeNodeDataNodepublic boolean getChildrenLoaded()
TreeNode
getChildrenLoaded in interface TreeNodeDataNodepublic void setChildrenLoaded(boolean flag)
TreeNode
setChildrenLoaded in interface TreeNodeDataNodepublic java.lang.Object get(java.lang.Object key)
TreeNode
get in interface TreeNodepublic boolean containsKey(java.lang.Object key)
TreeNode
containsKey in interface TreeNodepublic java.util.Set getDataKeys()
getDataKeys in interface TreeNodepublic boolean isLocked()
TreeNode
isLocked in interface TreeNodeDataNodepublic IdentityLock getImmutableLock()
TreeNode
getImmutableLock in interface TreeNodeDataNodepublic IdentityLock getLock()
TreeNode
getLock in interface TreeNodeDataNodepublic java.util.Map getData()
TreeNode
getData in interface TreeNodeDataNodepublic int numAttributes()
TreeNode
numAttributes in interface TreeNode
public void put(java.util.Map data,
boolean erase)
TreeNode
put in interface TreeNodeerase - true to erase the existing contents
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
TreeNode
put in interface TreeNode
public TreeNode getOrCreateChild(java.lang.Object child_name,
GlobalTransaction gtx,
boolean createIfNotExists)
TreeNode
getOrCreateChild in interface TreeNodeDataNode
public TreeNode createChild(java.lang.Object child_name,
Fqn fqn,
TreeNode parent)
TreeNode
createChild in interface TreeNode
public TreeNode createChild(java.lang.Object child_name,
Fqn fqn,
TreeNode parent,
java.lang.Object key,
java.lang.Object value)
TreeNode
createChild in interface TreeNodepublic java.lang.Object remove(java.lang.Object key)
TreeNode
remove in interface TreeNodepublic void clear()
TreeNode
clear in interface TreeNode
public void printDetails(java.lang.StringBuffer sb,
int indent)
TreeNode
printDetails in interface TreeNode
public void printLockInfo(java.lang.StringBuffer sb,
int indent)
TreeNode
printLockInfo in interface TreeNodeDataNodepublic java.lang.String toString()
toString in class java.lang.Object
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
DataNode
clone in interface DataNodeclone in class AbstractNodejava.lang.CloneNotSupportedException
public boolean acquire(java.lang.Object caller,
long timeout,
int lock_type)
throws LockingException,
TimeoutException,
java.lang.InterruptedException
DataNode
acquire in interface DataNodetimeout - milliseconds to waitlock_type - lock type to use
LockingException
TimeoutException
java.lang.InterruptedException
protected boolean acquireReadLock(java.lang.Object caller,
long timeout)
throws LockingException,
TimeoutException,
java.lang.InterruptedException
LockingException
TimeoutException
java.lang.InterruptedException
protected boolean acquireWriteLock(java.lang.Object caller,
long timeout)
throws LockingException,
TimeoutException,
java.lang.InterruptedException
LockingException
TimeoutException
java.lang.InterruptedException
public java.util.Set acquireAll(java.lang.Object caller,
long timeout,
int lock_type)
throws LockingException,
TimeoutException,
java.lang.InterruptedException
TreeNode
acquireAll in interface TreeNodeLockingException
TimeoutException
java.lang.InterruptedExceptionDataNodepublic void release(java.lang.Object caller)
TreeNode
release in interface TreeNodeDataNodepublic void releaseForce()
TreeNode
releaseForce in interface TreeNodeDataNodepublic void releaseAll(java.lang.Object owner)
TreeNode
releaseAll in interface TreeNodeDataNodepublic void releaseAllForce()
TreeNode
releaseAllForce in interface TreeNodeDataNode
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
Fqn elements, children as a Map, and data as a Map.
(This is no longer used within JBoss Cache.)
writeExternal in interface java.io.Externalizablejava.io.IOExceptionTreeCacheMarshaller
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||