@ThreadSafe public class NodeReference<K,V> extends Object implements InternalNode<K,V>
InternalNode. Simple indirection
is all this class does, allowing other processes to change the delegate.
The delegate is a volatile field so the class is thread safe.
This is used to wrap all NodeInvocationDelegates in the DataContainer
when using Configuration.NodeLockingScheme.MVCC and IsolationLevel.READ_COMMITTED.
ReadCommittedNode| Constructor and Description |
|---|
NodeReference(InternalNode<K,V> delegate) |
| 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) |
NodeSPI<K,V> |
addChildDirect(Fqn f) |
NodeSPI<K,V> |
addChildDirect(Fqn f,
boolean notify) |
void |
addChildDirect(NodeSPI<K,V> child) |
NodeSPI<K,V> |
addChildDirect(Object o,
boolean notify) |
void |
addChildDirect(Object nodeName,
Node<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.
|
boolean |
equals(Object o) |
V |
get(K key) |
CacheSPI<K,V> |
getCache() |
InternalNode<K,V> |
getChild(Fqn f) |
InternalNode<K,V> |
getChild(Object childName) |
NodeSPI<K,V> |
getChildDirect(Fqn fqn) |
NodeSPI<K,V> |
getChildDirect(Object childName) |
Set<InternalNode<K,V>> |
getChildren() |
Set<InternalNode<K,V>> |
getChildren(boolean includeMarkedForRemoval) |
Set<NodeSPI<K,V>> |
getChildrenDirect() |
Set<NodeSPI<K,V>> |
getChildrenDirect(boolean includeMarkedForRemoval) |
ConcurrentMap<Object,InternalNode<K,V>> |
getChildrenMap() |
Map<Object,Node<K,V>> |
getChildrenMapDirect() |
Set<Object> |
getChildrenNames() |
Map<K,V> |
getData() |
InternalNode<K,V> |
getDelegate() |
Fqn |
getFqn() |
Map |
getInternalState(boolean onlyInternalState) |
Set<K> |
getKeys() |
NodeLock |
getLock() |
NodeSPI<K,V> |
getOrCreateChild(Object child_name,
GlobalTransaction gtx) |
NodeSPI<K,V> |
getParent() |
DataVersion |
getVersion() |
boolean |
hasChildren() |
int |
hashCode() |
boolean |
isChildrenLoaded() |
boolean |
isDataLoaded() |
boolean |
isLockForChildInsertRemove() |
boolean |
isRemoved() |
boolean |
isResident() |
boolean |
isValid() |
void |
markAsRemoved(boolean marker,
boolean recursive) |
void |
printDetails(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 flag) |
void |
setChildrenMap(ConcurrentMap<Object,InternalNode<K,V>> children) |
void |
setChildrenMapDirect(Map<Object,Node<K,V>> children) |
void |
setDataLoaded(boolean dataLoaded) |
void |
setDelegate(InternalNode<K,V> delegate)
Sets the internal node to delegate to.
|
void |
setFqn(Fqn fqn)
Sets the node's Fqn
|
void |
setInternalState(Map state) |
void |
setLockForChildInsertRemove(boolean lockForChildInsertRemove) |
void |
setRemoved(boolean marker) |
void |
setResident(boolean resident) |
void |
setValid(boolean valid,
boolean recursive) |
void |
setVersion(DataVersion version) |
String |
toString() |
public NodeReference(InternalNode<K,V> delegate)
public final InternalNode<K,V> getDelegate()
public final void setDelegate(InternalNode<K,V> delegate)
delegate - node to delegate to.public final NodeSPI<K,V> getParent()
getParent in interface InternalNode<K,V>public final CacheSPI<K,V> getCache()
getCache in interface InternalNode<K,V>public final boolean isChildrenLoaded()
isChildrenLoaded in interface InternalNode<K,V>public final void setChildrenLoaded(boolean flag)
setChildrenLoaded in interface InternalNode<K,V>public final NodeSPI<K,V> getOrCreateChild(Object child_name, GlobalTransaction gtx)
getOrCreateChild in interface InternalNode<K,V>public final InternalNode<K,V> getChild(Fqn f)
getChild in interface InternalNode<K,V>public final InternalNode<K,V> getChild(Object childName)
getChild in interface InternalNode<K,V>public final Set<InternalNode<K,V>> getChildren()
getChildren in interface InternalNode<K,V>public final Set<InternalNode<K,V>> getChildren(boolean includeMarkedForRemoval)
getChildren in interface InternalNode<K,V>public final ConcurrentMap<Object,InternalNode<K,V>> getChildrenMap()
getChildrenMap in interface InternalNode<K,V>public final void setChildrenMap(ConcurrentMap<Object,InternalNode<K,V>> children)
setChildrenMap in interface InternalNode<K,V>public final void addChild(Object nodeName, InternalNode<K,V> nodeToAdd)
addChild in interface InternalNode<K,V>public final void addChild(InternalNode<K,V> child)
addChild in interface InternalNode<K,V>public final void addChild(InternalNode<K,V> child, boolean safe)
InternalNodeaddChild in interface InternalNode<K,V>child - child to addsafe - safety flagpublic final NodeSPI<K,V> addChildDirect(Fqn f)
addChildDirect in interface InternalNode<K,V>public final NodeSPI<K,V> addChildDirect(Fqn f, boolean notify)
addChildDirect in interface InternalNode<K,V>public final NodeSPI<K,V> addChildDirect(Object o, boolean notify)
addChildDirect in interface InternalNode<K,V>public final void clear()
clear in interface InternalNode<K,V>public final NodeSPI<K,V> getChildDirect(Fqn fqn)
getChildDirect in interface InternalNode<K,V>public final Set<Object> getChildrenNames()
getChildrenNames in interface InternalNode<K,V>public final boolean containsKey(K key)
containsKey in interface InternalNode<K,V>public final void setInternalState(Map state)
setInternalState in interface InternalNode<K,V>public final boolean removeChild(Object childName)
removeChild in interface InternalNode<K,V>public final boolean removeChild(Fqn f)
removeChild in interface InternalNode<K,V>public final Map<Object,Node<K,V>> getChildrenMapDirect()
getChildrenMapDirect in interface InternalNode<K,V>public final void setChildrenMapDirect(Map<Object,Node<K,V>> children)
setChildrenMapDirect in interface InternalNode<K,V>public final void putAll(Map<? extends K,? extends V> data)
putAll in interface InternalNode<K,V>public final void removeChildren()
removeChildren in interface InternalNode<K,V>public final void setVersion(DataVersion version)
setVersion in interface InternalNode<K,V>public final DataVersion getVersion()
getVersion in interface InternalNode<K,V>public final Fqn getFqn()
getFqn in interface InternalNode<K,V>public final void setFqn(Fqn fqn)
InternalNodesetFqn in interface InternalNode<K,V>fqn - Fqn to set topublic final NodeSPI<K,V> getChildDirect(Object childName)
getChildDirect in interface InternalNode<K,V>public final Set<NodeSPI<K,V>> getChildrenDirect()
getChildrenDirect in interface InternalNode<K,V>public final boolean hasChildren()
hasChildren in interface InternalNode<K,V>public final Set<NodeSPI<K,V>> getChildrenDirect(boolean includeMarkedForRemoval)
getChildrenDirect in interface InternalNode<K,V>public final boolean isDataLoaded()
isDataLoaded in interface InternalNode<K,V>public final void setDataLoaded(boolean dataLoaded)
setDataLoaded in interface InternalNode<K,V>public final boolean isValid()
isValid in interface InternalNode<K,V>public final void setValid(boolean valid,
boolean recursive)
setValid in interface InternalNode<K,V>public final boolean isLockForChildInsertRemove()
isLockForChildInsertRemove in interface InternalNode<K,V>public final void setLockForChildInsertRemove(boolean lockForChildInsertRemove)
setLockForChildInsertRemove in interface InternalNode<K,V>public final Map getInternalState(boolean onlyInternalState)
getInternalState in interface InternalNode<K,V>public final void releaseObjectReferences(boolean recursive)
releaseObjectReferences in interface InternalNode<K,V>public final boolean isRemoved()
isRemoved in interface InternalNode<K,V>public final void setRemoved(boolean marker)
setRemoved in interface InternalNode<K,V>public final void markAsRemoved(boolean marker,
boolean recursive)
markAsRemoved in interface InternalNode<K,V>public final void setResident(boolean resident)
setResident in interface InternalNode<K,V>public final boolean isResident()
isResident in interface InternalNode<K,V>public final InternalNode<K,V> copy()
InternalNodecopy in interface InternalNode<K,V>public final NodeLock getLock()
getLock in interface InternalNode<K,V>public final void addChildDirect(Object nodeName, Node<K,V> nodeToAdd)
addChildDirect in interface InternalNode<K,V>public final void addChildDirect(NodeSPI<K,V> child)
addChildDirect in interface InternalNode<K,V>public final void printDetails(StringBuilder sb, int indent)
printDetails in interface InternalNode<K,V>Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.