|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.context.ContextManager
public class ContextManager
A ContextManager instances allows for rooting, querying and access
to select portions of the global context graph.
| Nested Class Summary | |
|---|---|
static interface |
ContextManager.Association
Creates parent and child associations to the target context node. |
static interface |
ContextManager.Dissociation
Removes existing parent and child associations from the target context node. |
| Constructor Summary | |
|---|---|
ContextManager()
|
|
| Method Summary | |
|---|---|
static ContextManager.Association |
associate(Object object)
Create an Association instance for the supplied object. |
static void |
deregisterContextCreationListener(ContextCreationListener listener)
|
void |
deregisterContextListener(ContextListener listener)
Removes a previously registered listener from the listener set. |
static ContextManager.Dissociation |
dissociate(Object object)
Create a Dissociation instance for the supplied object. |
static TreeNode |
nodeFor(Object object)
Return the TreeNode associated with this object. |
Set<TreeNode> |
query(Query query)
Run the supplied Query against this ContextManager's
root context. |
TreeNode |
queryForSingleton(Query query)
Return the unique node selected by running this query against this ContextManager's root context. |
static void |
registerContextCreationListener(ContextCreationListener listener)
|
void |
registerContextListener(ContextListener listener)
Registers a listener for additions and removals to this ContextManager's context graph. |
void |
root(Object object)
Root the given object's context node in this ContextManager
instance. |
void |
uproot(Object object)
Remove the given object's context node from this ContextManager
root set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContextManager()
| Method Detail |
|---|
public static ContextManager.Association associate(Object object)
Association instance for the supplied object.
object - the object to be associated
public static ContextManager.Dissociation dissociate(Object object)
Dissociation instance for the supplied object.
object - the object to be dissociated
public static TreeNode nodeFor(Object object)
TreeNode associated with this object.
Returns null if the supplied object has no associated context node.
object - object to lookup node for
TreeNode associated with this objectpublic static void registerContextCreationListener(ContextCreationListener listener)
public static void deregisterContextCreationListener(ContextCreationListener listener)
public void root(Object object)
ContextManager
instance.
object - object whose context will be rootedpublic void uproot(Object object)
ContextManager
root set.
object - object whose context will be uprootedpublic Set<TreeNode> query(Query query)
Query against this ContextManager's
root context.
The initial node in the queries traversal will be the node whose children
form the root set of this ContextManager. That is, the following
code will select the root set of this instance.
public static Setroots(ContextManager manager) { return manager.query(QueryBuilder.queryBuilder().children().build()); }
query - the query to execute
public TreeNode queryForSingleton(Query query)
throws IllegalStateException
ContextManager's root context.
If this query does not return a single unique result then an
IllegalStateException will be thrown. More details on the query
execution context can be found in query(Query).
query - the query to execute
IllegalStateException - if the query does not select a unique nodequery(Query),
QueryBuilder.ensureUnique()public void registerContextListener(ContextListener listener)
ContextManager's context graph.
listener - listener to be registeredpublic void deregisterContextListener(ContextListener listener)
listener - listener to be deregistered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||