org.jboss.cache
Interface DataNode

All Superinterfaces:
TreeNode
All Known Implementing Classes:
AbstractNode

public interface DataNode
extends TreeNode

Represents a DataNode in the cache. TODO: MANIK - add more detailed Javadocs.

Author:
Manik Surtani (manik@jboss.org)

Field Summary
static int LOCK_TYPE_NONE
          Declare locking type with the intention to read or write data
static int LOCK_TYPE_READ
           
static int LOCK_TYPE_WRITE
           
static boolean PRINT_LOCK_DETAILS
           
 
Method Summary
 boolean acquire(java.lang.Object caller, long lock_acquisition_timeout, int lockTypeWrite)
           
 java.util.Set acquireAll(java.lang.Object caller, long timeout, int lock_type)
          Not to be exposed.
 void addChild(java.lang.Object child_name, TreeNode n)
          Adds the (already created) child node.
 boolean childExists(java.lang.Object child_name)
           
 java.lang.Object clone()
           
 boolean containsKey(java.lang.Object key)
           
 TreeNode createChild(java.lang.Object child_name, Fqn fqn, TreeNode parent, java.lang.Object key, java.lang.Object value)
           
 boolean getChildrenLoaded()
          Not to be exposed.
 java.util.Map getData()
          Returns a copy of the attributes.
 java.util.Set getDataKeys()
           
 IdentityLock getLock()
          Not to be exposed.
 TreeNode getOrCreateChild(java.lang.Object child_name, GlobalTransaction gtx, boolean createIfNotExists)
          Creates a new child of this node if it doesn't exist.
 boolean hasChildren()
           
 boolean isLocked()
          Not to be exposed.
 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)
          Not to be exposed.
 void releaseAll(java.lang.Object owner)
          Not to be exposed.
 void releaseAllForce()
          Not to be exposed.
 void removeAllChildren()
           
 void setChildren(java.util.Map children)
          Sets Map
 void setChildrenLoaded(boolean b)
          Not to be exposed.
 void setRecursiveTreeCacheInstance(TreeCache cache)
          Not to be exposed.
 
Methods inherited from interface org.jboss.cache.TreeNode
clear, createChild, get, getChild, getChildren, getFqn, getImmutableLock, getName, getParent, put, put, put, release, releaseForce, remove, removeChild
 

Field Detail

LOCK_TYPE_NONE

public static final int LOCK_TYPE_NONE
Declare locking type with the intention to read or write data

See Also:
Constant Field Values

LOCK_TYPE_READ

public static final int LOCK_TYPE_READ
See Also:
Constant Field Values

LOCK_TYPE_WRITE

public static final int LOCK_TYPE_WRITE
See Also:
Constant Field Values

PRINT_LOCK_DETAILS

public static final boolean PRINT_LOCK_DETAILS
Method Detail

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface TreeNode
See Also:
DataNode

getDataKeys

public java.util.Set getDataKeys()
Specified by:
getDataKeys in interface TreeNode
See Also:
DataNode

childExists

public boolean childExists(java.lang.Object child_name)
Specified by:
childExists in interface TreeNode
See Also:
DataNode

setChildren

public void setChildren(java.util.Map children)
Sets Map

Specified by:
setChildren in interface TreeNode
See Also:
DataNode

numAttributes

public int numAttributes()
Specified by:
numAttributes in interface TreeNode
See Also:
DataNode

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface TreeNode
See Also:
DataNode

getOrCreateChild

public 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()

Specified by:
getOrCreateChild in interface TreeNode
See Also:
DataNode

createChild

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

removeAllChildren

public void removeAllChildren()
Specified by:
removeAllChildren in interface TreeNode
See Also:
DataNode

print

public void print(java.lang.StringBuffer sb,
                  int indent)
Specified by:
print in interface TreeNode

printDetails

public void printDetails(java.lang.StringBuffer sb,
                         int indent)
Specified by:
printDetails in interface TreeNode

printIndent

public void printIndent(java.lang.StringBuffer sb,
                        int indent)
Specified by:
printIndent in interface TreeNode

addChild

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

Specified by:
addChild in interface TreeNode
Parameters:
child_name -
n -
See Also:
DataNode

printLockInfo

public void printLockInfo(java.lang.StringBuffer sb,
                          int indent)
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
printLockInfo in interface TreeNode
See Also:
DataNode

isLocked

public boolean isLocked()
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
isLocked in interface TreeNode
See Also:
DataNode

releaseAll

public void releaseAll(java.lang.Object owner)
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
releaseAll in interface TreeNode
See Also:
DataNode

releaseAllForce

public void releaseAllForce()
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
releaseAllForce in interface TreeNode
See Also:
DataNode

acquireAll

public java.util.Set acquireAll(java.lang.Object caller,
                                long timeout,
                                int lock_type)
                         throws LockingException,
                                TimeoutException,
                                java.lang.InterruptedException
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
acquireAll in interface TreeNode
LockingException
TimeoutException
java.lang.InterruptedException
See Also:
DataNode

setRecursiveTreeCacheInstance

public void setRecursiveTreeCacheInstance(TreeCache cache)
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
setRecursiveTreeCacheInstance in interface TreeNode
See Also:
DataNode

getChildrenLoaded

public boolean getChildrenLoaded()
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
getChildrenLoaded in interface TreeNode
See Also:
DataNode

setChildrenLoaded

public void setChildrenLoaded(boolean b)
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
setChildrenLoaded in interface TreeNode
See Also:
DataNode

acquire

public boolean acquire(java.lang.Object caller,
                       long lock_acquisition_timeout,
                       int lockTypeWrite)
                throws java.lang.InterruptedException,
                       LockingException,
                       TimeoutException
java.lang.InterruptedException
LockingException
TimeoutException

getLock

public IdentityLock getLock()
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
getLock in interface TreeNode
See Also:
DataNode

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException

getData

public java.util.Map getData()
Description copied from interface: TreeNode
Returns a copy of the attributes. Use get(Object key) instead.

Specified by:
getData in interface TreeNode
See Also:
DataNode


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