org.jboss.cache
Class VersionedNode<K,V>

java.lang.Object
  extended by org.jboss.cache.AbstractNode<K,V>
      extended by org.jboss.cache.UnversionedNode<K,V>
          extended by org.jboss.cache.PessimisticUnversionedNode<K,V>
              extended by org.jboss.cache.VersionedNode<K,V>
All Implemented Interfaces:
InternalNode<K,V>

Deprecated. will be removed along with optimistic and pessimistic locking.

@Deprecated
public class VersionedNode<K,V>
extends PessimisticUnversionedNode<K,V>

VersionedNode extends the UnversionedNode by adding a DataVersion property.

Unlike UnversionedNode, this node supports getVersion() and setVersion(org.jboss.cache.optimistic.DataVersion) defined in NodeSPI

Typically used when the cache mode configured is Configuration.NodeLockingScheme.OPTIMISTIC

Since:
2.0.0
Author:
Manik Surtani (manik AT jboss DOT org)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.cache.AbstractNode
AbstractNode.NodeFlags
 
Field Summary
 
Fields inherited from class org.jboss.cache.PessimisticUnversionedNode
lock, lockStrategyFactory, nodeFactory
 
Fields inherited from class org.jboss.cache.UnversionedNode
cache, data, delegate, log, trace
 
Fields inherited from class org.jboss.cache.AbstractNode
children, flags, fqn
 
Constructor Summary
VersionedNode(Fqn fqn, NodeSPI<K,V> parent, Map<K,V> data, CacheSPI<K,V> cache)
          Deprecated.  
 
Method Summary
 VersionedNode copy()
          Deprecated. Creates a new instance of the same type and copies internal state.
 Map getInternalState(boolean onlyInternalState)
          Deprecated.  
 NodeSPI<K,V> getParent()
          Deprecated. Returns the parent.
 DataVersion getVersion()
          Deprecated. Returns the version id of this node.
protected  void initLock()
          Deprecated. Optimistically locked nodes (VersionedNodes) will always use repeatable read.
 void setInternalState(Map state)
          Deprecated.  
 void setVersion(DataVersion version)
          Deprecated. Sets the version id of this node.
 
Methods inherited from class org.jboss.cache.PessimisticUnversionedNode
addChildDirect, addChildDirect, addChildDirect, addChildDirect, addChildDirect, getChildDirect, getChildDirect, getChildrenDirect, getChildrenDirect, getChildrenMapDirect, getLock, getOrCreateChild, injectDependencies, injectLockStrategyFactory, markAsRemoved, printDetailsInMap, releaseObjectReferences, setChildrenMapDirect, setFqn, setValid, toString
 
Methods inherited from class org.jboss.cache.UnversionedNode
addChild, addChild, addChild, clear, containsKey, copyDataMap, copyInternals, downgradeDataMapIfNeeded, get, getCache, getChild, getChild, getChildren, getChildren, getChildrenMap, getChildrenNames, getData, getDelegate, getFqn, getKeys, hasChildren, initFlags, isChildrenLoaded, isDataLoaded, isLockForChildInsertRemove, isValid, printDetails, printIndent, put, putAll, remove, removeChild, removeChild, removeChildren, setChildrenLoaded, setChildrenMap, setDataLoaded, setDelegate, setLockForChildInsertRemove, upgradeDataMap
 
Methods inherited from class org.jboss.cache.AbstractNode
equals, hashCode, isFlagSet, isRemoved, isResident, setFlag, setFlag, setRemoved, setResident, unsetFlag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.InternalNode
isRemoved, isResident, setRemoved, setResident
 

Constructor Detail

VersionedNode

public VersionedNode(Fqn fqn,
                     NodeSPI<K,V> parent,
                     Map<K,V> data,
                     CacheSPI<K,V> cache)
Deprecated. 
Method Detail

getVersion

public DataVersion getVersion()
Deprecated. 
Returns the version id of this node.

Specified by:
getVersion in interface InternalNode<K,V>
Overrides:
getVersion in class AbstractNode<K,V>
Returns:
the version

getParent

public NodeSPI<K,V> getParent()
Deprecated. 
Returns the parent.

Specified by:
getParent in interface InternalNode<K,V>
Overrides:
getParent in class UnversionedNode<K,V>

setVersion

public void setVersion(DataVersion version)
Deprecated. 
Sets the version id of this node.

Specified by:
setVersion in interface InternalNode<K,V>
Overrides:
setVersion in class AbstractNode<K,V>
Parameters:
version -

initLock

protected void initLock()
Deprecated. 
Optimistically locked nodes (VersionedNodes) will always use repeatable read.

Overrides:
initLock in class PessimisticUnversionedNode<K,V>

getInternalState

public Map getInternalState(boolean onlyInternalState)
Deprecated. 
Specified by:
getInternalState in interface InternalNode<K,V>
Overrides:
getInternalState in class UnversionedNode<K,V>

setInternalState

public void setInternalState(Map state)
Deprecated. 
Specified by:
setInternalState in interface InternalNode<K,V>
Overrides:
setInternalState in class UnversionedNode<K,V>

copy

public VersionedNode copy()
Deprecated. 
Description copied from interface: InternalNode
Creates a new instance of the same type and copies internal state. Note that a shallow copy is made for all fields except the data map, where a new map is created.

Specified by:
copy in interface InternalNode<K,V>
Overrides:
copy in class PessimisticUnversionedNode<K,V>
Returns:
a copy.


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