|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.cache.Node
Represents a node in the tree. Has a relative name and a Fqn. Maintains a hashmap. If the node is created in a replicated cache, the relative and fully qualified name, and the keys and values of the hashmap have to be serializable.
Note that current version supports different levels of transaction locking such
as simple locking (TreeCache.SERIALIZABLE
, or R/W lock with upgrade (
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.
Field Summary | |
protected static int |
INDENT
|
static int |
LOCK_TYPE_READ
Declare locking type with the intention to read or write data |
static int |
LOCK_TYPE_WRITE
|
static boolean |
PRINT_LOCK_DETAILS
|
Constructor Summary | |
Node()
|
|
Node(java.lang.Object child_name,
Fqn (src) fqn,
Node (src) parent,
java.util.Map data,
TreeCache (src) cache)
|
|
Node(java.lang.Object child_name,
Fqn (src) fqn,
Node (src) parent,
java.lang.Object key,
java.lang.Object value,
TreeCache (src) cache)
|
Method Summary | |
boolean |
acquire(java.lang.Object caller,
long timeout,
int lock_type)
Acquire a node object by locking it first. |
java.util.Set |
acquireAll(java.lang.Object caller,
long timeout,
int lock_type)
Acquires locks for the entire subtree |
protected boolean |
acquireReadLock(java.lang.Object caller,
long timeout)
|
protected boolean |
acquireWriteLock(java.lang.Object caller,
long timeout)
|
boolean |
childExists(java.lang.Object child_name)
|
protected java.util.Map |
children()
|
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
containsKey(java.lang.Object key)
|
Node (src) |
createChild(java.lang.Object child_name,
Fqn (src) fqn,
Node (src) parent)
|
Node (src) |
createChild(java.lang.Object child_name,
Fqn (src) fqn,
Node (src) parent,
java.util.Map data)
|
Node (src) |
createChild(java.lang.Object child_name,
Fqn (src) fqn,
Node (src) parent,
java.lang.Object key,
java.lang.Object value)
|
protected java.util.Map |
data()
|
java.lang.Object |
get(java.lang.Object key)
|
Node (src) |
getChild(java.lang.Object child_name)
|
java.util.Map |
getChildren()
|
java.util.Map |
getData()
Returns a copy of the attributes |
java.util.Set |
getDataKeys()
|
Fqn (src) |
getFqn()
|
IdentityLock (src) |
getImmutableLock()
Deprecated. Use getLock() instead |
IdentityLock (src) |
getLock()
|
java.lang.Object |
getName()
|
Node (src) |
getParent()
|
boolean |
hasChild()
Deprecated. Use hasChildren() instead |
boolean |
hasChildren()
|
protected void |
init()
|
protected void |
init(java.lang.Object child_name,
Fqn (src) fqn,
Node (src) parent,
TreeCache (src) cache)
|
protected java.util.Map |
initChildren()
|
protected java.util.Map |
initData()
|
int |
numAttributes()
|
void |
print(java.lang.StringBuffer sb,
int indent)
|
void |
printDetails(java.lang.StringBuffer sb,
int indent)
|
void |
printIndent(java.lang.StringBuffer sb,
int indent)
|
void |
printLockInfo(java.lang.StringBuffer sb,
int indent)
|
void |
put(java.util.Map data)
|
void |
put(java.util.Map data,
boolean erase)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
readExternal(java.io.ObjectInput in)
|
void |
release(java.lang.Object caller)
|
void |
releaseAll(java.lang.Object owner)
Releases locks for the entire subtree |
void |
releaseAllForce()
Releases locks for the entire subtree. |
void |
releaseForce()
|
java.lang.Object |
remove(java.lang.Object key)
|
void |
removeAllChildren()
|
void |
removeChild(java.lang.Object child_name)
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int LOCK_TYPE_READ
public static final int LOCK_TYPE_WRITE
protected static final int INDENT
public static final transient boolean PRINT_LOCK_DETAILS
Constructor Detail |
public Node()
public Node(java.lang.Object child_name, Fqn (src) fqn, Node (src) parent, java.util.Map data, TreeCache (src) cache)
public Node(java.lang.Object child_name, Fqn (src) fqn, Node (src) parent, java.lang.Object key, java.lang.Object value, TreeCache (src) cache)
Method Detail |
protected void init(java.lang.Object child_name, Fqn (src) fqn, Node (src) parent, TreeCache (src) cache)
protected void init()
protected java.util.Map initChildren()
protected java.util.Map initData()
protected java.util.Map children()
protected java.util.Map data()
public java.lang.Object getName()
public Fqn (src) getFqn()
public java.lang.Object get(java.lang.Object key)
public boolean containsKey(java.lang.Object key)
public Node (src) getChild(java.lang.Object child_name)
public Node (src) getParent()
public java.util.Set getDataKeys()
public boolean childExists(java.lang.Object child_name)
public IdentityLock (src) getImmutableLock()
public IdentityLock (src) getLock()
public java.util.Map getChildren()
public java.util.Map getData()
public int numAttributes()
public boolean hasChild()
hasChildren()
instead
public boolean hasChildren()
public void put(java.util.Map data, boolean erase)
public void put(java.util.Map data)
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
public Node (src) createChild(java.lang.Object child_name, Fqn (src) fqn, Node (src) parent)
public Node (src) createChild(java.lang.Object child_name, Fqn (src) fqn, Node (src) parent, java.util.Map data)
public Node (src) createChild(java.lang.Object child_name, Fqn (src) fqn, Node (src) parent, java.lang.Object key, java.lang.Object value)
public java.lang.Object remove(java.lang.Object key)
public void clear()
public void removeChild(java.lang.Object child_name)
public void removeAllChildren()
public void print(java.lang.StringBuffer sb, int indent)
public void printDetails(java.lang.StringBuffer sb, int indent)
public void printLockInfo(java.lang.StringBuffer sb, int indent)
public void printIndent(java.lang.StringBuffer sb, int indent)
public java.lang.String toString()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public boolean acquire(java.lang.Object caller, long timeout, int lock_type) throws LockingException (src) , TimeoutException (src) , java.lang.InterruptedException
lock_type
.
caller
- Tansaction context owner.timeout
- Timeout in millisecondslock_type
- @see Node
LockingException (src)
TimeoutException (src)
java.lang.InterruptedException
protected boolean acquireReadLock(java.lang.Object caller, long timeout) throws LockingException (src) , TimeoutException (src) , java.lang.InterruptedException
LockingException (src)
TimeoutException (src)
java.lang.InterruptedException
protected boolean acquireWriteLock(java.lang.Object caller, long timeout) throws LockingException (src) , TimeoutException (src) , java.lang.InterruptedException
LockingException (src)
TimeoutException (src)
java.lang.InterruptedException
public java.util.Set acquireAll(java.lang.Object caller, long timeout, int lock_type) throws LockingException (src) , TimeoutException (src) , java.lang.InterruptedException
LockingException (src)
TimeoutException (src)
java.lang.InterruptedException
public void release(java.lang.Object caller)
public void releaseForce()
public void releaseAll(java.lang.Object owner)
public void releaseAllForce()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
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 (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |