org.jboss.cache
Interface InternalNode<K,V>

All Known Implementing Classes:
NodeReference, PessimisticUnversionedNode, UnversionedNode, VersionedNode

public interface InternalNode<K,V>

An internal node interface, that represents nodes that directly form the tree structure in the cache. This is as opposed to Node and its NodeSPI sub-interface, which are typically implemented by delegates which then delegate calls to internal nodes, potentially after passing the call up an interceptor chain.

All calls on an InternalNode are executed directly on the data structure. Usually, XXXDirect() calls on NodeSPI delegate to calls on an InternalNode, for example, NodeSPI.putDirect(Object, Object) delegating to put(Object, Object).

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

Method Summary
 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)
          Deprecated. 
 NodeSPI<K,V> addChildDirect(Fqn f, boolean notify)
          Deprecated. 
 void addChildDirect(NodeSPI<K,V> child)
          Deprecated. 
 NodeSPI<K,V> addChildDirect(Object o, boolean notify)
          Deprecated. 
 void addChildDirect(Object nodeName, Node<K,V> nodeToAdd)
          Deprecated. 
 void clear()
           
 boolean containsKey(K key)
           
 InternalNode<K,V> copy()
          Creates a new instance of the same type and copies internal state.
 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)
          Deprecated. 
 NodeSPI<K,V> getChildDirect(Object childName)
          Deprecated. 
 Set<InternalNode<K,V>> getChildren()
           
 Set<InternalNode<K,V>> getChildren(boolean includeMarkedForRemoval)
           
 Set<NodeSPI<K,V>> getChildrenDirect()
          Deprecated. 
 Set<NodeSPI<K,V>> getChildrenDirect(boolean includeMarkedForRemoval)
          Deprecated. 
 ConcurrentMap<Object,InternalNode<K,V>> getChildrenMap()
           
 Map<Object,Node<K,V>> getChildrenMapDirect()
          Deprecated. 
 Set<Object> getChildrenNames()
           
 Map<K,V> getData()
           
 Fqn getFqn()
           
 Map getInternalState(boolean onlyInternalState)
           
 Set<K> getKeys()
           
 NodeLock getLock()
           
 NodeSPI<K,V> getOrCreateChild(Object childName, GlobalTransaction gtx)
          Deprecated. should use the NodeFactory instead.
 NodeSPI<K,V> getParent()
           
 DataVersion getVersion()
           
 boolean hasChildren()
           
 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)
          Deprecated. 
 void setDataLoaded(boolean dataLoaded)
           
 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)
           
 

Method Detail

get

V get(K key)

getData

Map<K,V> getData()

put

V put(K key,
      V value)

putAll

void putAll(Map<? extends K,? extends V> data)

remove

V remove(K key)

clear

void clear()

getKeys

Set<K> getKeys()

containsKey

boolean containsKey(K key)

setInternalState

void setInternalState(Map state)

getInternalState

Map getInternalState(boolean onlyInternalState)

releaseObjectReferences

void releaseObjectReferences(boolean recursive)

getFqn

Fqn getFqn()
Returns:
the node's Fqn

setFqn

void setFqn(Fqn fqn)
Sets the node's Fqn

Parameters:
fqn - Fqn to set to

hasChildren

boolean hasChildren()

getChildDirect

@Deprecated
NodeSPI<K,V> getChildDirect(Fqn fqn)
Deprecated. 


getChildDirect

@Deprecated
NodeSPI<K,V> getChildDirect(Object childName)
Deprecated. 


getChildrenDirect

@Deprecated
Set<NodeSPI<K,V>> getChildrenDirect()
Deprecated. 


getChildrenDirect

@Deprecated
Set<NodeSPI<K,V>> getChildrenDirect(boolean includeMarkedForRemoval)
Deprecated. 


getChildrenMapDirect

@Deprecated
Map<Object,Node<K,V>> getChildrenMapDirect()
Deprecated. 


setChildrenMapDirect

@Deprecated
void setChildrenMapDirect(Map<Object,Node<K,V>> children)
Deprecated. 


addChildDirect

@Deprecated
void addChildDirect(Object nodeName,
                               Node<K,V> nodeToAdd)
Deprecated. 


addChildDirect

@Deprecated
void addChildDirect(NodeSPI<K,V> child)
Deprecated. 


addChildDirect

@Deprecated
NodeSPI<K,V> addChildDirect(Fqn f)
Deprecated. 


addChildDirect

@Deprecated
NodeSPI<K,V> addChildDirect(Fqn f,
                                       boolean notify)
Deprecated. 


addChildDirect

@Deprecated
NodeSPI<K,V> addChildDirect(Object o,
                                       boolean notify)
Deprecated. 


getOrCreateChild

@Deprecated
NodeSPI<K,V> getOrCreateChild(Object childName,
                                         GlobalTransaction gtx)
Deprecated. should use the NodeFactory instead.


getChild

InternalNode<K,V> getChild(Fqn f)

getChild

InternalNode<K,V> getChild(Object childName)

getChildren

Set<InternalNode<K,V>> getChildren()

getChildren

Set<InternalNode<K,V>> getChildren(boolean includeMarkedForRemoval)

getChildrenMap

ConcurrentMap<Object,InternalNode<K,V>> getChildrenMap()

setChildrenMap

void setChildrenMap(ConcurrentMap<Object,InternalNode<K,V>> children)

addChild

void addChild(Object nodeName,
              InternalNode<K,V> nodeToAdd)

addChild

void addChild(InternalNode<K,V> child)

addChild

void addChild(InternalNode<K,V> child,
              boolean safe)
Same as above, except that if safe is true, any Fqn ancestry checking is skipped. Don't set safe to true unless you really know what you are doing!

Parameters:
child - child to add
safe - safety flag

getChildrenNames

Set<Object> getChildrenNames()

removeChildren

void removeChildren()

removeChild

boolean removeChild(Object childName)

removeChild

boolean removeChild(Fqn f)

copy

InternalNode<K,V> copy()
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.

Returns:
a copy.

isChildrenLoaded

boolean isChildrenLoaded()

setChildrenLoaded

void setChildrenLoaded(boolean flag)

isDataLoaded

boolean isDataLoaded()

setDataLoaded

void setDataLoaded(boolean dataLoaded)

isValid

boolean isValid()

setValid

void setValid(boolean valid,
              boolean recursive)

isLockForChildInsertRemove

boolean isLockForChildInsertRemove()

setLockForChildInsertRemove

void setLockForChildInsertRemove(boolean lockForChildInsertRemove)

isRemoved

boolean isRemoved()

setRemoved

void setRemoved(boolean marker)

markAsRemoved

void markAsRemoved(boolean marker,
                   boolean recursive)

setResident

void setResident(boolean resident)

isResident

boolean isResident()

printDetails

void printDetails(StringBuilder sb,
                  int indent)

getParent

NodeSPI<K,V> getParent()

getCache

CacheSPI<K,V> getCache()

setVersion

void setVersion(DataVersion version)

getVersion

DataVersion getVersion()

getLock

NodeLock getLock()


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