|
||||||||||
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 TreeNode
getParent
in class AbstractNode
protected java.util.Map children()
AbstractNode
children
in class AbstractNode
public void setRecursiveTreeCacheInstance(TreeCache cache)
setRecursiveTreeCacheInstance
in interface TreeNode
DataNode
public boolean getChildrenLoaded()
TreeNode
getChildrenLoaded
in interface TreeNode
DataNode
public void setChildrenLoaded(boolean flag)
TreeNode
setChildrenLoaded
in interface TreeNode
DataNode
public java.lang.Object get(java.lang.Object key)
TreeNode
get
in interface TreeNode
public boolean containsKey(java.lang.Object key)
TreeNode
containsKey
in interface TreeNode
public java.util.Set getDataKeys()
getDataKeys
in interface TreeNode
public boolean isLocked()
TreeNode
isLocked
in interface TreeNode
DataNode
public IdentityLock getImmutableLock()
TreeNode
getImmutableLock
in interface TreeNode
DataNode
public IdentityLock getLock()
TreeNode
getLock
in interface TreeNode
DataNode
public java.util.Map getData()
TreeNode
getData
in interface TreeNode
DataNode
public int numAttributes()
TreeNode
numAttributes
in interface TreeNode
public void put(java.util.Map data, boolean erase)
TreeNode
put
in interface TreeNode
erase
- true to erase the existing contentspublic 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 TreeNode
DataNode
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 TreeNode
public java.lang.Object remove(java.lang.Object key)
TreeNode
remove
in interface TreeNode
public 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 TreeNode
DataNode
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
DataNode
clone
in interface DataNode
clone
in class AbstractNode
java.lang.CloneNotSupportedException
public boolean acquire(java.lang.Object caller, long timeout, int lock_type) throws LockingException, TimeoutException, java.lang.InterruptedException
DataNode
acquire
in interface DataNode
timeout
- 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 TreeNode
LockingException
TimeoutException
java.lang.InterruptedException
DataNode
public void release(java.lang.Object caller)
TreeNode
release
in interface TreeNode
DataNode
public void releaseForce()
TreeNode
releaseForce
in interface TreeNode
DataNode
public void releaseAll(java.lang.Object owner)
TreeNode
releaseAll
in interface TreeNode
DataNode
public void releaseAllForce()
TreeNode
releaseAllForce
in interface TreeNode
DataNode
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.Externalizable
java.io.IOException
TreeCacheMarshaller
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |