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.VersionedNode<K,V>

public class VersionedNode<K,V>
extends UnversionedNode<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@jboss.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.UnversionedNode
delegate, lock, lockStrategyFactory, log, trace
 
Fields inherited from class org.jboss.cache.AbstractNode
children, flags, fqn
 
Constructor Summary
protected VersionedNode(Fqn fqn, NodeSPI<K,V> parent, Map<K,V> data, CacheSPI<K,V> cache)
           
 
Method Summary
 Map getInternalState(boolean onlyInternalState)
           
 NodeSPI<K,V> getParent()
          Returns the parent.
 DataVersion getVersion()
          Returns the version id of this node.
protected  void initLock()
          Optimistically locked nodes (VersionedNodes) will always use repeatable read.
 void setInternalState(Map state)
           
 void setVersion(DataVersion version)
          Sets the version id of this node.
 
Methods inherited from class org.jboss.cache.UnversionedNode
addChild, addChildDirect, addChildDirect, addChildDirect, addChildDirect, clearDataDirect, get, getCache, getChildDirect, getChildDirect, getChildrenDirect, getChildrenDirect, getChildrenMapDirect, getChildrenNamesDirect, getDataDirect, getDelegate, getDirect, getFqn, getKeysDirect, getLock, getOrCreateChild, hasChildrenDirect, initFlags, injectDependencies, isChildrenLoaded, isDataLoaded, isLockForChildInsertRemove, isValid, printDetails, put, putAll, putAllDirect, putDirect, releaseObjectReferences, remove, removeChildDirect, removeChildDirect, removeChildrenDirect, removeDirect, setChildrenLoaded, setChildrenMapDirect, setDataLoaded, setDelegate, setFqn, setLockForChildInsertRemove, setValid, toString
 
Methods inherited from class org.jboss.cache.AbstractNode
equals, hashCode, isDeleted, isFlagSet, isResident, markAsDeleted, markAsDeleted, setFlag, setFlag, setResident, unsetFlag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionedNode

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

getVersion

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

Overrides:
getVersion in class UnversionedNode<K,V>
Returns:
the version

getParent

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

Overrides:
getParent in class UnversionedNode<K,V>

setVersion

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

Overrides:
setVersion in class UnversionedNode<K,V>
Parameters:
version -

initLock

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

Overrides:
initLock in class UnversionedNode<K,V>

getInternalState

public Map getInternalState(boolean onlyInternalState)
Overrides:
getInternalState in class UnversionedNode<K,V>

setInternalState

public void setInternalState(Map state)
Overrides:
setInternalState in class UnversionedNode<K,V>


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