| 
 | |||||||||||
| 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_READDeclare locking type with the intention to read or write data | 
| static int | LOCK_TYPE_WRITE | 
| 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) | |
| Node(TreeCache cache) | |
| Method Summary | |
|  boolean | acquire(Object owner,
        long timeout,
        int lock_type)Acquire a node object by locking it first. | 
| protected  void | acquireAll(Object owner,
           long timeout,
           int lock_type)Acquires locks for the entire subtree | 
| protected  boolean | acquireReadLock(Object owner,
                long timeout) | 
| protected  boolean | acquireWriteLock(Object owner,
                 long timeout) | 
|  boolean | childExists(Object child_name) | 
|  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) | 
|  Object | get(Object key) | 
|  Node | getChild(Object child_name) | 
|  Map | getChildren() | 
|  Map | getData() | 
|  Set | getDataKeys() | 
|  Fqn | getFqn() | 
|  IdentityLock | getImmutableLock() | 
|  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) | 
|  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 owner) | 
| protected  void | releaseAll(Object owner)Releases locks for the entire subtree | 
| protected  void | releaseAllForce()Releases locks for the entire subtree. | 
| protected  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
| Constructor Detail | 
public Node()
public Node(TreeCache cache)
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()
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 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
CloneNotSupportedExceptionpublic boolean acquire(Object owner, long timeout, int lock_type) throws LockingException, TimeoutException
lock_type.
owner - Tansaction context owner.timeout - Timeout in millisecondslock_type - @see Node
LockingException
TimeoutExceptionprotected boolean acquireReadLock(Object owner, long timeout) throws LockingException, TimeoutException
LockingException
TimeoutExceptionprotected boolean acquireWriteLock(Object owner, long timeout) throws LockingException, TimeoutException
LockingException
TimeoutExceptionprotected void acquireAll(Object owner, long timeout, int lock_type) throws LockingException, TimeoutException
LockingException
TimeoutExceptionpublic void release(Object owner)
protected void releaseForce()
protected void releaseAll(Object owner)
protected void releaseAllForce()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||