org.jboss.cache.mvcc
Class NullMarkerNodeForRemoval

java.lang.Object
  extended by org.jboss.cache.invocation.AbstractInvocationDelegate
      extended by org.jboss.cache.invocation.NodeInvocationDelegate
          extended by org.jboss.cache.mvcc.ReadCommittedNode
              extended by org.jboss.cache.mvcc.RepeatableReadNode
                  extended by org.jboss.cache.mvcc.NullMarkerNodeForRemoval
All Implemented Interfaces:
Node, NodeSPI
Direct Known Subclasses:
NullMarkerNode

public class NullMarkerNodeForRemoval
extends RepeatableReadNode

A specific type of null marker node, used for removal of nodes that don't exist

Since:
3.1.0
Author:
Manik Surtani

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.cache.mvcc.ReadCommittedNode
ReadCommittedNode.Flags
 
Field Summary
 
Fields inherited from class org.jboss.cache.mvcc.ReadCommittedNode
backup, flags, parent
 
Fields inherited from class org.jboss.cache.invocation.NodeInvocationDelegate
node
 
Fields inherited from class org.jboss.cache.invocation.AbstractInvocationDelegate
componentRegistry, configuration, invocationContextContainer, invoker, originLocal
 
Constructor Summary
NullMarkerNodeForRemoval(InternalNode parent, Fqn fqn)
           
 
Method Summary
 Set getChildrenDirect()
          Functionally the same as Node.getChildren() except that it operates directly on the node and bypasses the interceptor chain.
 Set getChildrenNamesDirect()
          Functionally the same as Node.getChildrenNames() except that it operates directly on the node and bypasses the interceptor chain.
 Map getDataDirect()
          Functionally the same as Node.getData() except that it operates directly on the node and bypasses the interceptor chain.
 Fqn getFqn()
          Returns the Fqn which represents the location of this Node in the cache structure.
 boolean isDeleted()
          Returns true if the instance has been deleted in the current transaction.
 boolean isNullNode()
           
 boolean isValid()
          Tests if a node reference is still valid.
 void setValid(boolean valid, boolean recursive)
          Sets the validity of a node.
protected  void updateNode(Fqn fqn, InvocationContext ctx, DataContainer dataContainer)
          Updates state changes on the current node in the underlying data structure.
 
Methods inherited from class org.jboss.cache.mvcc.RepeatableReadNode
markForUpdate
 
Methods inherited from class org.jboss.cache.mvcc.ReadCommittedNode
commitUpdate, getInternalParent, isChanged, isCreated, isFlagSet, lookupParent, markAsDeleted, markAsDeleted, rollbackUpdate, setChildrenLoaded, setCreated, setDataLoaded, setFlag, unsetFlag
 
Methods inherited from class org.jboss.cache.invocation.NodeInvocationDelegate
addChild, addChild, addChildDirect, addChildDirect, addChildDirect, addChildDirect, assertValid, clearData, clearDataDirect, containsKeyDirect, dataSize, equals, get, getCache, getChild, getChild, getChildDirect, getChildDirect, getChildren, getChildrenDirect, getChildrenMapDirect, getChildrenNames, getData, getDelegationTarget, getDirect, getInternalState, getKeys, getKeysDirect, getLock, getOrCreateChild, getParent, getParentDirect, getVersion, hasChild, hasChild, hasChildrenDirect, hashCode, injectDependencies, isChildrenLoaded, isDataLoaded, isLeaf, isLockForChildInsertRemove, isResident, print, printDetails, put, putAll, putAllDirect, putDirect, putIfAbsent, releaseObjectReferences, remove, removeChild, removeChild, removeChildDirect, removeChildDirect, removeChildrenDirect, removeDirect, replace, replace, replaceAll, setChildrenMapDirect, setFqn, setInternalState, setLockForChildInsertRemove, setResident, setVersion, toString
 
Methods inherited from class org.jboss.cache.invocation.AbstractInvocationDelegate
assertIsConstructed, initialize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullMarkerNodeForRemoval

public NullMarkerNodeForRemoval(InternalNode parent,
                                Fqn fqn)
Method Detail

getFqn

public Fqn getFqn()
Description copied from interface: Node
Returns the Fqn which represents the location of this Node in the cache structure. The Fqn returned is absolute.

Specified by:
getFqn in interface Node
Overrides:
getFqn in class NodeInvocationDelegate
Returns:
The Fqn which represents the location of this Node in the cache structure. The Fqn returned is absolute.

isNullNode

public boolean isNullNode()
Specified by:
isNullNode in interface NodeSPI
Overrides:
isNullNode in class ReadCommittedNode
Returns:
always returns true

isValid

public boolean isValid()
Description copied from interface: Node
Tests if a node reference is still valid. A node reference may become invalid if it has been removed, invalidated or moved, either locally or remotely. If a node is invalid, it should be fetched again from the cache or a valid parent node. Operations on invalid nodes will throw a NodeNotValidException.

Specified by:
isValid in interface Node
Overrides:
isValid in class NodeInvocationDelegate
Returns:
always returns true so that any get commands, upon getting this node, will ignore the node as though it were invalid.

isDeleted

public boolean isDeleted()
Description copied from interface: NodeSPI
Returns true if the instance has been deleted in the current transaction.

Specified by:
isDeleted in interface NodeSPI
Overrides:
isDeleted in class ReadCommittedNode
Returns:
always returns true so that any get commands, upon getting this node, will ignore the node as though it were removed.

updateNode

protected void updateNode(Fqn fqn,
                          InvocationContext ctx,
                          DataContainer dataContainer)
Description copied from class: ReadCommittedNode
Updates state changes on the current node in the underlying data structure.

Overrides:
updateNode in class RepeatableReadNode
ctx - invocation context
dataContainer - data container

getDataDirect

public Map getDataDirect()
Description copied from interface: NodeSPI
Functionally the same as Node.getData() except that it operates directly on the node and bypasses the interceptor chain.

Note that this returns a reference to access the node's data. This data should only be modified by the cache itself. This method should never return null.

The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a LockingException will be thrown.

Specified by:
getDataDirect in interface NodeSPI
Overrides:
getDataDirect in class NodeInvocationDelegate
Returns:
map containing data
See Also:
Node.getData()

getChildrenNamesDirect

public Set getChildrenNamesDirect()
Description copied from interface: NodeSPI
Functionally the same as Node.getChildrenNames() except that it operates directly on the node and bypasses the interceptor chain.

The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a LockingException will be thrown.

Specified by:
getChildrenNamesDirect in interface NodeSPI
Overrides:
getChildrenNamesDirect in class NodeInvocationDelegate
Returns:
set of children names
See Also:
Node.getChildrenNames()

getChildrenDirect

public Set getChildrenDirect()
Description copied from interface: NodeSPI
Functionally the same as Node.getChildren() except that it operates directly on the node and bypasses the interceptor chain.

The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a LockingException will be thrown.

Specified by:
getChildrenDirect in interface NodeSPI
Overrides:
getChildrenDirect in class NodeInvocationDelegate
Returns:
set of child nodes.
See Also:
Node.getChildren()

setValid

public void setValid(boolean valid,
                     boolean recursive)
Description copied from interface: NodeSPI
Sets the validity of a node. By default, all nodes are valid unless they are deleted, invalidated or moved, either locally or remotely. To be used in conjunction with Node.isValid().

Specified by:
setValid in interface NodeSPI
Overrides:
setValid in class NodeInvocationDelegate
Parameters:
valid - if true, the node is marked as valid; if false, the node is invalid.
recursive - if true, the validity flag passed in is applied to all children as well.


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.