|
|||||||||||
PREV CLASS NEXT CLASS | 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(Object child_name,
Fqn fqn,
Node parent,
Map data,
TreeCache cache)
|
|
Node(Object child_name,
Fqn fqn,
Node parent,
Object key,
Object value,
TreeCache cache)
|
Method Summary | |
boolean |
acquire(Object caller,
long timeout,
int lock_type)
Acquire a node object by locking it first. |
Set |
acquireAll(Object caller,
long timeout,
int lock_type)
Acquires locks for the entire subtree |
protected boolean |
acquireReadLock(Object caller,
long timeout)
|
protected boolean |
acquireWriteLock(Object caller,
long timeout)
|
boolean |
childExists(Object child_name)
|
protected Map |
children()
|
void |
clear()
|
Object |
clone()
|
boolean |
containsKey(Object key)
|
Node |
createChild(Object child_name,
Fqn fqn,
Node parent)
|
Node |
createChild(Object child_name,
Fqn fqn,
Node parent,
Map data)
|
Node |
createChild(Object child_name,
Fqn fqn,
Node parent,
Object key,
Object value)
|
protected Map |
data()
|
Object |
get(Object key)
|
Node |
getChild(Object child_name)
|
Map |
getChildren()
|
Map |
getData()
Returns a copy of the attributes |
Set |
getDataKeys()
|
Fqn |
getFqn()
|
IdentityLock |
getImmutableLock()
Deprecated. Use getLock() instead |
IdentityLock |
getLock()
|
Object |
getName()
|
Node |
getParent()
|
boolean |
hasChild()
Deprecated. Use hasChildren() instead |
boolean |
hasChildren()
|
protected void |
init()
|
protected void |
init(Object child_name,
Fqn fqn,
Node parent,
TreeCache cache)
|
protected Map |
initChildren()
|
protected Map |
initData()
|
int |
numAttributes()
|
void |
print(StringBuffer sb,
int indent)
|
void |
printDetails(StringBuffer sb,
int indent)
|
void |
printIndent(StringBuffer sb,
int indent)
|
void |
printLockInfo(StringBuffer sb,
int indent)
|
void |
put(Map data)
|
void |
put(Map data,
boolean erase)
|
Object |
put(Object key,
Object value)
|
void |
readExternal(ObjectInput in)
|
void |
release(Object caller)
|
void |
releaseAll(Object owner)
Releases locks for the entire subtree |
void |
releaseAllForce()
Releases locks for the entire subtree. |
void |
releaseForce()
|
Object |
remove(Object key)
|
void |
removeAllChildren()
|
void |
removeChild(Object child_name)
|
String |
toString()
|
void |
writeExternal(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(Object child_name, Fqn fqn, Node parent, Map data, TreeCache cache)
public Node(Object child_name, Fqn fqn, Node parent, Object key, Object value, TreeCache cache)
Method Detail |
protected void init(Object child_name, Fqn fqn, Node parent, TreeCache cache)
protected void init()
protected Map initChildren()
protected Map initData()
protected Map children()
protected Map data()
public Object getName()
public Fqn getFqn()
public Object get(Object key)
public boolean containsKey(Object key)
public Node getChild(Object child_name)
public Node getParent()
public Set getDataKeys()
public boolean childExists(Object child_name)
public IdentityLock getImmutableLock()
public IdentityLock getLock()
public Map getChildren()
public Map getData()
public int numAttributes()
public boolean hasChild()
hasChildren()
instead
public boolean hasChildren()
public void put(Map data, boolean erase)
public void put(Map data)
public Object put(Object key, Object value)
public Node createChild(Object child_name, Fqn fqn, Node parent)
public Node createChild(Object child_name, Fqn fqn, Node parent, Map data)
public Node createChild(Object child_name, Fqn fqn, Node parent, Object key, Object value)
public Object remove(Object key)
public void clear()
public void removeChild(Object child_name)
public void removeAllChildren()
public void print(StringBuffer sb, int indent)
public void printDetails(StringBuffer sb, int indent)
public void printLockInfo(StringBuffer sb, int indent)
public void printIndent(StringBuffer sb, int indent)
public String toString()
public Object clone() throws CloneNotSupportedException
CloneNotSupportedException
public boolean acquire(Object caller, long timeout, int lock_type) throws LockingException, TimeoutException, InterruptedException
lock_type
.
caller
- Tansaction context owner.timeout
- Timeout in millisecondslock_type
- @see Node
LockingException
TimeoutException
InterruptedException
protected boolean acquireReadLock(Object caller, long timeout) throws LockingException, TimeoutException, InterruptedException
LockingException
TimeoutException
InterruptedException
protected boolean acquireWriteLock(Object caller, long timeout) throws LockingException, TimeoutException, InterruptedException
LockingException
TimeoutException
InterruptedException
public Set acquireAll(Object caller, long timeout, int lock_type) throws LockingException, TimeoutException, InterruptedException
LockingException
TimeoutException
InterruptedException
public void release(Object caller)
public void releaseForce()
public void releaseAll(Object owner)
public void releaseAllForce()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |