org.jboss.cache
Interface TreeNode

All Known Subinterfaces:
DataNode, WorkspaceNode
All Known Implementing Classes:
AbstractNode, Node, OptimisticTreeNode, 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.23 $
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)
          Creates a new child of this node if it doesn't exist.
 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

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

getFqn

Fqn getFqn()

getChild

TreeNode getChild(java.lang.Object childName)

removeChild

void removeChild(java.lang.Object childName)

getParent

TreeNode getParent()

put

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

put

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

remove

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

get

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

clear

void clear()

put

void put(java.util.Map data)

getName

java.lang.Object getName()

print

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

printDetails

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

printIndent

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

containsKey

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

getChildren

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

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

childExists

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

numAttributes

int numAttributes()
See Also:
DataNode

hasChildren

boolean hasChildren()
See Also:
DataNode

createChild

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

removeAllChildren

void removeAllChildren()
See Also:
DataNode

addChild

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

See Also:
DataNode

getData

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

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

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

See Also:
DataNode

getLock

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

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

See Also:
DataNode

getOrCreateChild

TreeNode getOrCreateChild(java.lang.Object child_name,
                          GlobalTransaction gtx,
                          boolean createIfNotExists)
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

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

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

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

See Also:
DataNode

releaseAll

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

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

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

See Also:
DataNode

acquireAll

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.

Throws:
LockingException
TimeoutException
java.lang.InterruptedException
See Also:
DataNode

setRecursiveTreeCacheInstance

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

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

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

See Also:
DataNode

setChildrenLoaded

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

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

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

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.