org.jboss.cache
Interface TreeNode

All Known Subinterfaces:
DataNode, WorkspaceNode
All Known Implementing Classes:
AbstractNode, WorkspaceNodeImpl

public interface TreeNode

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.

This class is not synchronized, so access to instances of TreeNode need to be run under an isolation level > NONE.

Version:
$Revision: 1.10.2.2.10.1 $
Author:
Bela Ban March 25 2003, Ben Wang, Manik Surtani (manik@jboss.org)

Method Summary
 java.util.Set acquireAll(java.lang.Object caller, long timeout, int lock_type)
          Deprecated. Will be removed in JBossCache 1.3.
 void addChild(java.lang.Object child_name, TreeNode n)
          Adds the (already created) child node.
 boolean childExists(java.lang.Object child_name)
           
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 TreeNode createChild(java.lang.Object child_name, Fqn fqn, TreeNode parent)
           
 TreeNode createChild(java.lang.Object child_name, Fqn fqn, TreeNode parent, java.lang.Object key, java.lang.Object value)
           
 java.lang.Object get(java.lang.Object key)
           
 TreeNode getChild(java.lang.Object childName)
           
 java.util.Map getChildren()
          Will always return an unmodifiable map.
 boolean getChildrenLoaded()
          Deprecated. Will be removed in JBossCache 1.3.
 java.util.Map getData()
          Deprecated. Will be removed in JBossCache 1.3.
 java.util.Set getDataKeys()
           
 Fqn getFqn()
           
 IdentityLock getImmutableLock()
          Deprecated. Will be removed in JBossCache 1.3.
 IdentityLock getLock()
          Deprecated. Will be removed in JBossCache 1.3.
 java.lang.Object getName()
           
 TreeNode getOrCreateChild(java.lang.Object child_name, GlobalTransaction gtx, boolean createIfNotExists)
          Deprecated. Will be removed in JBossCache 1.3.
 TreeNode getParent()
           
 boolean hasChildren()
           
 boolean isLocked()
          Deprecated. Will be removed in JBossCache 1.3.
 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)
          Deprecated. Will be removed in JBossCache 1.3.
 void put(java.util.Map data)
           
 void put(java.util.Map data, boolean eraseData)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void release(java.lang.Object caller)
          Deprecated. Will be removed in JBossCache 1.3.
 void releaseAll(java.lang.Object owner)
          Deprecated. Will be removed in JBossCache 1.3.
 void releaseAllForce()
          Deprecated. Will be removed in JBossCache 1.3.
 void releaseForce()
          Deprecated. Will be removed in JBossCache 1.3.
 java.lang.Object remove(java.lang.Object key)
           
 void removeAllChildren()
           
 void removeChild(java.lang.Object childName)
           
 void setChildren(java.util.Map children)
          Deprecated. Will be removed in JBossCache 1.3.
 void setChildrenLoaded(boolean b)
          Deprecated. Will be removed in JBossCache 1.3.
 void setRecursiveTreeCacheInstance(TreeCache cache)
          Deprecated. Will be removed in JBossCache 1.3.
 

Method Detail

createChild

public TreeNode createChild(java.lang.Object child_name,
                            Fqn fqn,
                            TreeNode parent)

getFqn

public Fqn getFqn()

getChild

public TreeNode getChild(java.lang.Object childName)

removeChild

public void removeChild(java.lang.Object childName)

getParent

public TreeNode getParent()

put

public void put(java.util.Map data,
                boolean eraseData)

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)

remove

public java.lang.Object remove(java.lang.Object key)

get

public java.lang.Object get(java.lang.Object key)

clear

public void clear()

put

public void put(java.util.Map data)

getName

public java.lang.Object getName()

print

public void print(java.lang.StringBuffer sb,
                  int indent)

printDetails

public void printDetails(java.lang.StringBuffer sb,
                         int indent)

printIndent

public void printIndent(java.lang.StringBuffer sb,
                        int indent)

containsKey

public boolean containsKey(java.lang.Object key)
See Also:
DataNode

getChildren

public java.util.Map getChildren()
Will always return an unmodifiable map. Implementations need to make sure of this. Use createChild or removeChild ...

Returns:
Map
See Also:
DataNode

getDataKeys

public java.util.Set getDataKeys()
See Also:
DataNode

childExists

public boolean childExists(java.lang.Object child_name)
See Also:
DataNode

numAttributes

public int numAttributes()
See Also:
DataNode

hasChildren

public boolean hasChildren()
See Also:
DataNode

createChild

public TreeNode createChild(java.lang.Object child_name,
                            Fqn fqn,
                            TreeNode parent,
                            java.lang.Object key,
                            java.lang.Object value)
See Also:
DataNode

removeAllChildren

public void removeAllChildren()
See Also:
DataNode

addChild

public void addChild(java.lang.Object child_name,
                     TreeNode n)
Adds the (already created) child node. Replaces existing node if present.

See Also:
DataNode

getData

public java.util.Map getData()
Deprecated. Will be removed in JBossCache 1.3.

Returns a copy of the attributes. Use get(Object key) instead.

See Also:
DataNode

getImmutableLock

public IdentityLock getImmutableLock()
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

getLock

public IdentityLock getLock()
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

getOrCreateChild

public TreeNode getOrCreateChild(java.lang.Object child_name,
                                 GlobalTransaction gtx,
                                 boolean createIfNotExists)
Deprecated. Will be removed in JBossCache 1.3.

Creates a new child of this node if it doesn't exist. Also notifies the cache that the new child has been created. dded this new getOrCreateChild() method to avoid thread contention on create_lock in PessimisticLockInterceptor.lock() Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

printLockInfo

public void printLockInfo(java.lang.StringBuffer sb,
                          int indent)
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

isLocked

public boolean isLocked()
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

releaseAll

public void releaseAll(java.lang.Object owner)
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

releaseAllForce

public void releaseAllForce()
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

acquireAll

public java.util.Set acquireAll(java.lang.Object caller,
                                long timeout,
                                int lock_type)
                         throws LockingException,
                                TimeoutException,
                                java.lang.InterruptedException
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

LockingException
TimeoutException
java.lang.InterruptedException
See Also:
DataNode

setRecursiveTreeCacheInstance

public void setRecursiveTreeCacheInstance(TreeCache cache)
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

getChildrenLoaded

public boolean getChildrenLoaded()
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

setChildrenLoaded

public void setChildrenLoaded(boolean b)
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

setChildren

public void setChildren(java.util.Map children)
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes. Sets Map

See Also:
DataNode

release

public void release(java.lang.Object caller)
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode

releaseForce

public void releaseForce()
Deprecated. Will be removed in JBossCache 1.3.

Not to be exposed. Internal calls should use impl classes.

See Also:
DataNode


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.