ContextManager instances allows for rooting, querying and access
to select portions of the global context graph.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | ContextManager.Association
Creates parent and child associations to the target context node. |
| public static interface | ContextManager.Dissociation
Removes existing parent and child associations from the target context node. |
| Modifier and Type | Field and Description |
|---|---|
| private static final WeakIdentityHashMap | |
| private static final Collection | |
| private static final Logger | |
| private final RootNode |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static ContextManager. | |
| private static void | |
| private static void | |
| public static void | |
| public void | deregisterContextListener(ContextListener
listener to be deregistered listener)Removes a previously registered listener from the listener set. |
| private static void | |
| public static ContextManager. | Returns: a dissociation instancethe object to be dissociated object)Create a |
| private static void | |
| private static MutableTreeNode | |
| private static MutableTreeNode | |
| public static TreeNode | |
| public Set | |
| public TreeNode | Returns: the node selected by the querythe query to execute query)Return the unique node selected by running this query against this
|
| public static void | |
| public void | registerContextListener(ContextListener
listener to be registered listener)Registers a listener for additions and removals to this
|
| public void | |
| public void |
| CONTEXT_OBJECTS | back to summary |
|---|---|
| private static final WeakIdentityHashMap<Object, MutableTreeNode> CONTEXT_OBJECTS | |
| contextCreationListeners | back to summary |
|---|---|
| private static final Collection<ContextCreationListener> contextCreationListeners | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| root | back to summary |
|---|---|
| private final RootNode root | |
| ContextManager | back to summary |
|---|---|
| public ContextManager() | |
| associate | back to summary |
|---|---|
| public static ContextManager. Create an
| |
| associate | back to summary |
|---|---|
| private static void associate(Object child, Object parent) | |
| contextCreated | back to summary |
|---|---|
| private static void contextCreated(Object object) | |
| deregisterContextCreationListener | back to summary |
|---|---|
| public static void deregisterContextCreationListener(ContextCreationListener listener) | |
| deregisterContextListener | back to summary |
|---|---|
| public void deregisterContextListener(ContextListener listener) Removes a previously registered listener from the listener set.
| |
| discoverAssociations | back to summary |
|---|---|
| private static void discoverAssociations(Object origin) | |
| dissociate | back to summary |
|---|---|
| public static ContextManager. Create a
| |
| dissociate | back to summary |
|---|---|
| private static void dissociate(Object child, Object parent) | |
| getOrCreateTreeNode | back to summary |
|---|---|
| private static MutableTreeNode getOrCreateTreeNode(Object object) | |
| getTreeNode | back to summary |
|---|---|
| private static MutableTreeNode getTreeNode(Object object) | |
| nodeFor | back to summary |
|---|---|
| public static TreeNode nodeFor(Object object) Return the
Returns | |
| query | back to summary |
|---|---|
| public Set Run the supplied
The initial node in the queries traversal will be the node whose children
form the root set of this
public static Set<TreeNode> roots(ContextManager manager) {
return manager.query(QueryBuilder.queryBuilder().children().build());
}
| |
| queryForSingleton | back to summary |
|---|---|
| public TreeNode queryForSingleton(Query query) throws IllegalStateException Return the unique node selected by running this query against this
If this query does not return a single unique result then an
| |
| registerContextCreationListener | back to summary |
|---|---|
| public static void registerContextCreationListener(ContextCreationListener listener) | |
| registerContextListener | back to summary |
|---|---|
| public void registerContextListener(ContextListener listener) Registers a listener for additions and removals to this
| |
| root | back to summary |
|---|---|
| public void root(Object object) Root the given object's context node in this
| |
| uproot | back to summary |
|---|---|
| public void uproot(Object object) Remove the given object's context node from this
| |
Mutations performed to the parent and child node sets of the target node are also accompanied by the equivalent changes to the reverse relationship in the supplied object's context node. This ensures that parent/child relationships are properly consistent.
| Modifier and Type | Method and Description |
|---|---|
| public ContextManager. | |
| public ContextManager. | Returns: this association objectobject whose context node will be associated parent)Adds the supplied object's context node as a parent of the target context node. |
| withChild | back to summary |
|---|---|
| public ContextManager. Adds the supplied object's context node as a child of the target context node.
| |
| withParent | back to summary |
|---|---|
| public ContextManager. Adds the supplied object's context node as a parent of the target context node.
| |
Mutations performed to the parent and child node sets of the target node are also accompanied by the equivalent changes to the reverse relationship in the supplied object's context node. This ensures that parent/child relationships are properly consistent.
| Modifier and Type | Method and Description |
|---|---|
| public ContextManager. | |
| public ContextManager. | Returns: this dissociation objectobject whose context node will be dissociated parent)Removes the supplied object's context from the parent node set of the target context node. |
| fromChild | back to summary |
|---|---|
| public ContextManager. Removes the supplied object's context from the child node set of the target context node.
| |
| fromParent | back to summary |
|---|---|
| public ContextManager. Removes the supplied object's context from the parent node set of the target context node.
| |