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.
 java.lang.Object clone()
           
 boolean getChildrenLoaded()
          Not to be exposed.
 java.util.Map getData()
          Returns a copy of the attributes.
 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 isLocked()
          Not to be exposed.
 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 setChildren(java.util.Map children)
          Not to be exposed.
 void setChildrenLoaded(boolean b)
          Not to be exposed.
 void setRecursiveTreeCacheInstance(TreeCache cache)
          Not to be exposed.
 
Methods inherited from interface org.jboss.cache.TreeNode
addChild, childExists, clear, containsKey, createChild, createChild, get, getChild, getChildren, getDataKeys, getFqn, getImmutableLock, getName, getParent, hasChildren, numAttributes, put, put, put, release, releaseForce, remove, removeAllChildren, 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

setChildren

public void setChildren(java.util.Map children)
Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes. Sets Map

Specified by:
setChildren 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. Added this new getOrCreateChild() method to avoid thread contention on create_lock in PessimisticLockInterceptor.lock()

Specified by:
getOrCreateChild 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

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
Throws:
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
Throws:
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
Throws:
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.