Top Description Fields Constructors Methods
org.terracotta.context

pack-priv Class ContextAwareTreeNode

extends Object
implements TreeNode
Class Inheritance
All Implemented Interfaces
org.terracotta.context.TreeNode, org.terracotta.context.WeakIdentityHashMap.Cleanable
Imports
org.terracotta.statistics.StatisticsManager, java.util.Collection, .List, .Set

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 ContextAwareTreeNode#clean() that will make sure the context is removed from the org.terracotta.statistics.PassThroughStatistic

Field Summary

Modifier and TypeField and Description
private Object
private TreeNode

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public Set<? extends TreeNode>
getChildren()

Implements org.terracotta.context.TreeNode.getChildren.

Returns the immediate children of this context.
public ContextElement
getContext()

Implements org.terracotta.context.TreeNode.getContext.

Returns the context information associated with this node.
public List<? extends TreeNode>
getPath()

Implements org.terracotta.context.TreeNode.getPath.

Returns the unique rooting path of this context element.
public Collection<List<? extends TreeNode>>
getPaths()

Implements org.terracotta.context.TreeNode.getPaths.

Returns the complete set of rooting paths for this context element.
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private Object context
wrappedNodeback to summary
private TreeNode wrappedNode

Constructor Detail

ContextAwareTreeNodeback to summary
public ContextAwareTreeNode(TreeNode node, Object context)

Method Detail

cleanback to summary
public void clean()

Implements org.terracotta.context.WeakIdentityHashMap.Cleanable.clean.

Annotations
@Override
getChildrenback to summary
public Set<? extends TreeNode> getChildren()

Implements org.terracotta.context.TreeNode.getChildren.

Doc from org.terracotta.context.TreeNode.getChildren.

Returns the immediate children of this context.

Returns:Set<? extends TreeNode>

the context children

Annotations
@Override
getContextback to summary
public ContextElement getContext()

Implements org.terracotta.context.TreeNode.getContext.

Doc from org.terracotta.context.TreeNode.getContext.

Returns the context information associated with this node.

Returns:ContextElement

node context information

Annotations
@Override
getPathback to summary
public List<? extends TreeNode> getPath() throws IllegalStateException

Implements org.terracotta.context.TreeNode.getPath.

Doc from org.terracotta.context.TreeNode.getPath.

Returns 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 IllegalStateException will be thrown.

Returns:List<? extends TreeNode>

the unique rooting path

Annotations
@Override
Exceptions
IllegalStateException:
if the context is not uniquely rooted
getPathsback to summary
public Collection<List<? extends TreeNode>> getPaths()

Implements org.terracotta.context.TreeNode.getPaths.

Doc from org.terracotta.context.TreeNode.getPaths.

Returns the complete set of rooting paths for this context element.

Returns:Collection<List<? extends TreeNode>>

the set of rooting paths

Annotations
@Override
toTreeStringback to summary
public String toTreeString()

Implements org.terracotta.context.TreeNode.toTreeString.

Annotations
@Override