Package org.terracotta.context
Class ContextAwareTreeNode
java.lang.Object
org.terracotta.context.ContextAwareTreeNode
- All Implemented Interfaces:
TreeNode,WeakIdentityHashMap.Cleanable
Node used to wrap real tree node to keep the context object. Only used
by
ContextManager.nodeFor(Object) to allow the fluent interface
to forward the context to TreeNode methods.
Currently, the only method using it is clean()
that will make sure the context is removed from the PassThroughStatistic<T extends Serializable>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()Returns the immediate children of this context.Returns the context information associated with this node.getPath()Returns the unique rooting path of this context element.Collection<List<? extends TreeNode>>getPaths()Returns the complete set of rooting paths for this context element.
-
Field Details
-
context
-
wrappedNode
-
-
Constructor Details
-
ContextAwareTreeNode
-
-
Method Details
-
getChildren
Description copied from interface:TreeNodeReturns the immediate children of this context.- Specified by:
getChildrenin interfaceTreeNode- Returns:
- the context children
-
getPath
Description copied from interface:TreeNodeReturns the unique rooting path of this context element.If this context element is not connected to a root in any ContextManager instance or is rooted via multiple distinct paths then an
IllegalStateExceptionwill be thrown.- Specified by:
getPathin interfaceTreeNode- Returns:
- the unique rooting path
- Throws:
IllegalStateException- if the context is not uniquely rooted
-
getPaths
Description copied from interface:TreeNodeReturns the complete set of rooting paths for this context element. -
getContext
Description copied from interface:TreeNodeReturns the context information associated with this node.- Specified by:
getContextin interfaceTreeNode- Returns:
- node context information
-
toTreeString
- Specified by:
toTreeStringin interfaceTreeNode
-
clean
public void clean()- Specified by:
cleanin interfaceWeakIdentityHashMap.Cleanable
-