public class UnversionedNode<K,V> extends AbstractNode<K,V> implements InternalNode<K,V>
UnsupportedOperationException
for version-specific methods like AbstractNode.getVersion()
and
AbstractNode.setVersion(org.jboss.cache.optimistic.DataVersion)
, defined in NodeSPI
.AbstractNode.NodeFlags
Modifier and Type | Field and Description |
---|---|
protected CacheSPI<K,V> |
cache |
protected Map<K,V> |
data
Map of general data keys to values.
|
protected NodeSPI<K,V> |
delegate |
protected static org.apache.commons.logging.Log |
log
Debug log.
|
protected static boolean |
trace |
children, flags, fqn
Constructor and Description |
---|
UnversionedNode()
Constructs a new node with an FQN of Root.
|
UnversionedNode(Fqn fqn)
Constructs a new node a given Fqn
|
UnversionedNode(Fqn fqn,
CacheSPI<K,V> cache,
boolean lockForChildInsertRemove) |
UnversionedNode(Fqn fqn,
CacheSPI<K,V> cache,
boolean lockForChildInsertRemove,
Map<K,V> data) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(InternalNode<K,V> child) |
void |
addChild(InternalNode<K,V> child,
boolean safe)
Same as above, except that if safe is true, any Fqn ancestry checking is skipped.
|
void |
addChild(Object nodeName,
InternalNode<K,V> nodeToAdd) |
void |
clear() |
boolean |
containsKey(K key) |
InternalNode<K,V> |
copy()
Creates a new instance of the same type and copies internal state.
|
protected Map |
copyDataMap(Map<? extends K,? extends V> toCopyFrom) |
protected void |
copyInternals(UnversionedNode n) |
protected void |
downgradeDataMapIfNeeded() |
V |
get(K key) |
CacheSPI<K,V> |
getCache() |
InternalNode<K,V> |
getChild(Fqn f) |
InternalNode<K,V> |
getChild(Object childName) |
Set<InternalNode<K,V>> |
getChildren() |
Set<InternalNode<K,V>> |
getChildren(boolean includeMarkedForRemoval) |
ConcurrentMap<Object,InternalNode<K,V>> |
getChildrenMap() |
Set<Object> |
getChildrenNames() |
Map<K,V> |
getData() |
NodeSPI<K,V> |
getDelegate() |
Fqn |
getFqn()
Returns the name of this node.
|
Map |
getInternalState(boolean onlyInternalState) |
Set<K> |
getKeys() |
NodeSPI<K,V> |
getParent()
Returns a parent by checking the TreeMap by name.
|
boolean |
hasChildren() |
protected void |
initFlags()
This method initialises flags on the node, by setting DATA_LOADED to true and VALID to true and all other flags to false.
|
boolean |
isChildrenLoaded() |
boolean |
isDataLoaded()
Returns true if the data was loaded from the cache loader.
|
boolean |
isLockForChildInsertRemove() |
boolean |
isValid() |
void |
markAsRemoved(boolean marker,
boolean recursive) |
void |
printDetails(StringBuilder sb,
int indent) |
protected void |
printDetailsInMap(StringBuilder sb,
int indent)
Adds details of the node into a map as strings.
|
protected void |
printIndent(StringBuilder sb,
int indent) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> data) |
void |
releaseObjectReferences(boolean recursive) |
V |
remove(K key) |
boolean |
removeChild(Fqn f) |
boolean |
removeChild(Object childName) |
void |
removeChildren() |
void |
setChildrenLoaded(boolean childrenLoaded) |
void |
setChildrenMap(ConcurrentMap<Object,InternalNode<K,V>> children) |
void |
setDataLoaded(boolean dataLoaded)
Sets if the data was loaded from the cache loader.
|
void |
setDelegate(NodeSPI<K,V> delegate) |
void |
setFqn(Fqn fqn)
Sets the node's Fqn
|
void |
setInternalState(Map state) |
void |
setLockForChildInsertRemove(boolean lockForChildInsertRemove) |
void |
setValid(boolean valid,
boolean recursive) |
String |
toString()
Returns a debug string.
|
protected void |
upgradeDataMap() |
addChildDirect, addChildDirect, addChildDirect, addChildDirect, addChildDirect, equals, getChildDirect, getChildDirect, getChildrenDirect, getChildrenDirect, getChildrenMapDirect, getLock, getOrCreateChild, getVersion, hashCode, isFlagSet, isRemoved, isResident, setChildrenMapDirect, setFlag, setFlag, setRemoved, setResident, setVersion, unsetFlag
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addChildDirect, addChildDirect, addChildDirect, addChildDirect, addChildDirect, getChildDirect, getChildDirect, getChildrenDirect, getChildrenDirect, getChildrenMapDirect, getLock, getOrCreateChild, getVersion, isRemoved, isResident, setChildrenMapDirect, setRemoved, setResident, setVersion
protected static org.apache.commons.logging.Log log
protected static final boolean trace
public UnversionedNode()
public UnversionedNode(Fqn fqn)
fqn
- fqn of the nodepublic UnversionedNode(Fqn fqn, CacheSPI<K,V> cache, boolean lockForChildInsertRemove)
protected void initFlags()
AbstractNode.NodeFlags
enum.public NodeSPI<K,V> getParent()
getParent
in interface InternalNode<K,V>
public boolean isChildrenLoaded()
isChildrenLoaded
in interface InternalNode<K,V>
public void setChildrenLoaded(boolean childrenLoaded)
setChildrenLoaded
in interface InternalNode<K,V>
public InternalNode<K,V> getChild(Fqn f)
getChild
in interface InternalNode<K,V>
getChild
in class AbstractNode<K,V>
public InternalNode<K,V> getChild(Object childName)
getChild
in interface InternalNode<K,V>
getChild
in class AbstractNode<K,V>
public Set<InternalNode<K,V>> getChildren()
getChildren
in interface InternalNode<K,V>
getChildren
in class AbstractNode<K,V>
public Set<InternalNode<K,V>> getChildren(boolean includeMarkedForRemoval)
getChildren
in interface InternalNode<K,V>
getChildren
in class AbstractNode<K,V>
public ConcurrentMap<Object,InternalNode<K,V>> getChildrenMap()
getChildrenMap
in interface InternalNode<K,V>
getChildrenMap
in class AbstractNode<K,V>
public void setChildrenMap(ConcurrentMap<Object,InternalNode<K,V>> children)
setChildrenMap
in interface InternalNode<K,V>
setChildrenMap
in class AbstractNode<K,V>
public void addChild(Object nodeName, InternalNode<K,V> nodeToAdd)
addChild
in interface InternalNode<K,V>
addChild
in class AbstractNode<K,V>
public void addChild(InternalNode<K,V> child)
addChild
in interface InternalNode<K,V>
addChild
in class AbstractNode<K,V>
public void addChild(InternalNode<K,V> child, boolean safe)
InternalNode
addChild
in interface InternalNode<K,V>
addChild
in class AbstractNode<K,V>
child
- child to addsafe
- safety flagpublic void printDetails(StringBuilder sb, int indent)
printDetails
in interface InternalNode<K,V>
public void clear()
clear
in interface InternalNode<K,V>
public Set<Object> getChildrenNames()
getChildrenNames
in interface InternalNode<K,V>
public boolean containsKey(K key)
containsKey
in interface InternalNode<K,V>
public boolean removeChild(Object childName)
removeChild
in interface InternalNode<K,V>
public boolean removeChild(Fqn f)
removeChild
in interface InternalNode<K,V>
public void putAll(Map<? extends K,? extends V> data)
putAll
in interface InternalNode<K,V>
protected final void upgradeDataMap()
protected final void downgradeDataMapIfNeeded()
public void removeChildren()
removeChildren
in interface InternalNode<K,V>
public void markAsRemoved(boolean marker, boolean recursive)
markAsRemoved
in interface InternalNode<K,V>
markAsRemoved
in class AbstractNode<K,V>
protected final void printIndent(StringBuilder sb, int indent)
public Fqn getFqn()
getFqn
in interface InternalNode<K,V>
public void setFqn(Fqn fqn)
InternalNode
setFqn
in interface InternalNode<K,V>
fqn
- Fqn to set topublic boolean hasChildren()
hasChildren
in interface InternalNode<K,V>
protected void printDetailsInMap(StringBuilder sb, int indent)
public boolean isDataLoaded()
isDataLoaded
in interface InternalNode<K,V>
public void setDataLoaded(boolean dataLoaded)
setDataLoaded
in interface InternalNode<K,V>
public boolean isValid()
isValid
in interface InternalNode<K,V>
public void setValid(boolean valid, boolean recursive)
setValid
in interface InternalNode<K,V>
public boolean isLockForChildInsertRemove()
isLockForChildInsertRemove
in interface InternalNode<K,V>
public void setLockForChildInsertRemove(boolean lockForChildInsertRemove)
setLockForChildInsertRemove
in interface InternalNode<K,V>
public InternalNode<K,V> copy()
InternalNode
copy
in interface InternalNode<K,V>
protected void copyInternals(UnversionedNode n)
public void setInternalState(Map state)
setInternalState
in interface InternalNode<K,V>
public Map getInternalState(boolean onlyInternalState)
getInternalState
in interface InternalNode<K,V>
public void releaseObjectReferences(boolean recursive)
releaseObjectReferences
in interface InternalNode<K,V>
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.