org.jboss.cache.optimistic
Class WorkspaceNodeImpl

java.lang.Object
  |
  +--org.jboss.cache.optimistic.WorkspaceNodeImpl
All Implemented Interfaces:
TreeNode, WorkspaceNode

public class WorkspaceNodeImpl
extends java.lang.Object
implements WorkspaceNode

TODO: MANIK: Add proper javadocs

Author:
Manik Surtani (manik@jboss.org), Steve Woodcock (stevew@jofti.com)

Constructor Summary
WorkspaceNodeImpl()
          Default ctor for rehydration via externalizable
WorkspaceNodeImpl(DataNode node, TransactionWorkspace workspace)
           
WorkspaceNodeImpl(TreeNode node, TransactionWorkspace workspace)
          Deprecated.  
 
Method Summary
 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)
          Deprecated. Will be removed in JBossCache 1.3.
 boolean childExists(java.lang.Object child_name)
          Deprecated. Will be removed in JBossCache 1.3.
 void clear()
           
 boolean containsKey(java.lang.Object key)
          Deprecated. Will be removed in JBossCache 1.3.
 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)
          Deprecated. Will be removed in JBossCache 1.3.
 java.lang.Object get(java.lang.Object key)
           
 TreeNode getChild(java.lang.Object childName)
           
 java.util.Map getChildren()
          Dummy introduced to allow for a TreeNode.getChildren() method for backward compatibility.
 boolean getChildrenLoaded()
          Not to be exposed.
 java.util.Set getChildrenNames()
           
 java.util.Map getData()
          Dummy introduced to allow for a TreeNode.getData() method for backward compatibility.
 java.util.Set getDataKeys()
          Deprecated. Will be removed in JBossCache 1.3.
 Fqn getFqn()
           
 IdentityLock getImmutableLock()
          Not to be exposed.
 java.util.Set getKeys()
           
 IdentityLock getLock()
          Not to be exposed.
 java.util.Map getMergedChildren()
           
 java.util.Map getMergedData()
           
 java.lang.Object getName()
           
 DataNode getNode()
           
 TreeNode getOrCreateChild(java.lang.Object child_name, GlobalTransaction gtx, boolean createIfNotExists)
          Deprecated. Will be removed in JBossCache 1.3.
 TreeNode getParent()
           
 TransactionWorkspace getTransactionWorkspace()
           
 long getVersion()
           
 TreeNode getWrappedChild(java.lang.Object fqn)
           
 TreeNode getWrappedParent()
           
 boolean hasChildren()
          Deprecated. Will be removed in JBossCache 1.3.
 boolean isCreated()
           
 boolean isDeepDirty()
           
 boolean isDeleted()
           
 boolean isDirty()
           
 boolean isLocked()
          Not to be exposed.
 void markAsCreated()
           
 void markAsDeleted()
           
 int numAttributes()
          Deprecated. Will be removed in JBossCache 1.3.
 void print(java.lang.StringBuffer sb, int indent)
          Deprecated. Will be removed in JBossCache 1.3.
 void printDetails(java.lang.StringBuffer sb, int indent)
          Deprecated. Will be removed in JBossCache 1.3.
 void printIndent(java.lang.StringBuffer sb, int indent)
          Deprecated. Will be removed in JBossCache 1.3.
 void printLockInfo(java.lang.StringBuffer sb, int indent)
          Not to be exposed.
 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)
          Not to be exposed.
 void releaseAll(java.lang.Object owner)
          Not to be exposed.
 void releaseAllForce()
          Not to be exposed.
 void releaseForce()
          Not to be exposed.
 java.lang.Object remove(java.lang.Object key)
           
 void removeAllChildren()
          Deprecated. Will be removed in JBossCache 1.3.
 void removeChild(java.lang.Object childName)
           
 void setChildren(java.util.Map children)
          Deprecated. Will be removed in JBossCache 1.3.
 void setChildrenLoaded(boolean b)
          Not to be exposed.
 void setRecursiveTreeCacheInstance(TreeCache cache)
          Not to be exposed.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkspaceNodeImpl

public WorkspaceNodeImpl()
Default ctor for rehydration via externalizable


WorkspaceNodeImpl

public WorkspaceNodeImpl(TreeNode node,
                         TransactionWorkspace workspace)
Deprecated.  

Parameters:
node -
workspace -

WorkspaceNodeImpl

public WorkspaceNodeImpl(DataNode node,
                         TransactionWorkspace workspace)
Parameters:
node -
workspace -
Method Detail

isDirty

public boolean isDirty()
Specified by:
isDirty in interface WorkspaceNode
Returns:
Returns the dirty.

getFqn

public Fqn getFqn()
Specified by:
getFqn in interface TreeNode

put

public void put(java.util.Map data,
                boolean eraseData)
Specified by:
put in interface TreeNode

put

public void put(java.util.Map data)
Specified by:
put in interface TreeNode

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface TreeNode

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface TreeNode

clear

public void clear()
Specified by:
clear in interface TreeNode

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface TreeNode

getKeys

public java.util.Set getKeys()
Specified by:
getKeys in interface WorkspaceNode

getChildrenNames

public java.util.Set getChildrenNames()
Specified by:
getChildrenNames in interface WorkspaceNode

removeChild

public void removeChild(java.lang.Object childName)
Specified by:
removeChild in interface TreeNode

getParent

public TreeNode getParent()
Specified by:
getParent in interface TreeNode

getWrappedParent

public TreeNode getWrappedParent()

createChild

public TreeNode createChild(java.lang.Object child_name,
                            Fqn fqn,
                            TreeNode parent)
Specified by:
createChild in interface TreeNode

getChild

public TreeNode getChild(java.lang.Object childName)
Specified by:
getChild in interface TreeNode

getWrappedChild

public TreeNode getWrappedChild(java.lang.Object fqn)

getNode

public DataNode getNode()
Specified by:
getNode in interface WorkspaceNode

getVersion

public long getVersion()
Specified by:
getVersion in interface WorkspaceNode

getMergedChildren

public java.util.Map getMergedChildren()
Specified by:
getMergedChildren in interface WorkspaceNode

getMergedData

public java.util.Map getMergedData()
Specified by:
getMergedData in interface WorkspaceNode

markAsDeleted

public void markAsDeleted()
Specified by:
markAsDeleted in interface WorkspaceNode

isDeleted

public boolean isDeleted()
Specified by:
isDeleted in interface WorkspaceNode

getName

public java.lang.Object getName()
Specified by:
getName in interface TreeNode

getTransactionWorkspace

public TransactionWorkspace getTransactionWorkspace()
Specified by:
getTransactionWorkspace in interface WorkspaceNode

isDeepDirty

public boolean isDeepDirty()
Specified by:
isDeepDirty in interface WorkspaceNode

isCreated

public boolean isCreated()
Specified by:
isCreated in interface WorkspaceNode

markAsCreated

public void markAsCreated()
Specified by:
markAsCreated in interface WorkspaceNode

getData

public java.util.Map getData()
Dummy introduced to allow for a TreeNode.getData() method for backward compatibility. This impl always returns null.

Specified by:
getData in interface TreeNode
Returns:
null
See Also:
DataNode

getChildren

public java.util.Map getChildren()
Dummy introduced to allow for a TreeNode.getChildren() method for backward compatibility. This impl always returns null.

Specified by:
getChildren in interface TreeNode
Returns:
null
See Also:
DataNode

containsKey

public boolean containsKey(java.lang.Object key)
Deprecated. Will be removed in JBossCache 1.3.

Specified by:
containsKey in interface TreeNode
See Also:
DataNode

getDataKeys

public java.util.Set getDataKeys()
Deprecated. Will be removed in JBossCache 1.3.

Specified by:
getDataKeys in interface TreeNode
See Also:
DataNode

childExists

public boolean childExists(java.lang.Object child_name)
Deprecated. Will be removed in JBossCache 1.3.

Specified by:
childExists in interface TreeNode
See Also:
DataNode

getImmutableLock

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

Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
getImmutableLock in interface TreeNode
See Also:
DataNode

getLock

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

Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
getLock in interface TreeNode
See Also:
DataNode

numAttributes

public int numAttributes()
Deprecated. Will be removed in JBossCache 1.3.

Specified by:
numAttributes in interface TreeNode
See Also:
DataNode

hasChildren

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

Specified by:
hasChildren in interface TreeNode
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()

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)
Deprecated. Will be removed in JBossCache 1.3.

Specified by:
createChild in interface TreeNode
See Also:
DataNode

removeAllChildren

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

Specified by:
removeAllChildren in interface TreeNode
See Also:
DataNode

print

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

Specified by:
print in interface TreeNode
See Also:
DataNode

printDetails

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

Specified by:
printDetails in interface TreeNode
See Also:
DataNode

printIndent

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

Specified by:
printIndent in interface TreeNode
See Also:
DataNode

addChild

public void addChild(java.lang.Object child_name,
                     TreeNode n)
Deprecated. Will be removed in JBossCache 1.3.

Adds the (already created) child node. Replaces existing node if present.

Specified by:
addChild in interface TreeNode
See Also:
DataNode

printLockInfo

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

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()
Deprecated. Will be removed in JBossCache 1.3.

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)
Deprecated. Will be removed in JBossCache 1.3.

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()
Deprecated. Will be removed in JBossCache 1.3.

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
Deprecated. Will be removed in JBossCache 1.3.

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)
Deprecated. Will be removed in JBossCache 1.3.

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()
Deprecated. Will be removed in JBossCache 1.3.

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)
Deprecated. Will be removed in JBossCache 1.3.

Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
setChildrenLoaded in interface TreeNode
See Also:
DataNode

setChildren

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

Sets Map

Specified by:
setChildren in interface TreeNode
See Also:
DataNode

release

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

Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
release in interface TreeNode
See Also:
DataNode

releaseForce

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

Description copied from interface: TreeNode
Not to be exposed. Internal calls should use impl classes.

Specified by:
releaseForce in interface TreeNode
See Also:
DataNode

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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