public class ComponentTaskContext extends Object
| Constructor and Description |
|---|
ComponentTaskContext(Object componentKey,
ComponentTaskType type)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T> ConcurrentContainer.CreationalContextComponentAdapter<T> |
addComponentToContext(Object key,
ConcurrentContainer.CreationalContextComponentAdapter<T> ctx)
Adds the
CreationalContext of the component corresponding to the given key, to the dependency resolution
context |
ComponentTaskContext |
addToContext(Object componentKey)
This method will call
addToContext(Object, ComponentTaskType) with the lastTaskType as type |
ComponentTaskContext |
addToContext(Object componentKey,
ComponentTaskType type)
Creates a new
ComponentTaskContext based on the given dependency and the
already registered ones. |
void |
checkDependency(Object componentKey,
ComponentTaskType type)
Checks if the given dependency has already been defined, if so a
CyclicDependencyException
will be thrown. |
<T> T |
getComponentInstanceFromContext(Object key,
Class<T> bindType)
Tries to get the component related to the given from the context, if it can be found the current state of the component
instance is returned, otherwise
null is returned |
boolean |
isLast(Object componentKey)
Indicates whether the provided componentKey is the last dependency that has been added to the context.
|
boolean |
isRoot() |
ConcurrentContainer.CreationalContextComponentAdapter<?> |
removeComponentFromContext(Object key)
Removes the
CreationalContext of the component corresponding to the given key, from the dependency resolution
context |
ComponentTaskContext |
resetDependencies(Object key,
ComponentTaskType type)
Resets the dependencies but keeps the current dependency resolution context.
|
ComponentTaskContext |
setLastTaskType(ComponentTaskType lastTaskType)
Defines explicitly the last task type known
|
String |
toString() |
public ComponentTaskContext(Object componentKey, ComponentTaskType type)
public ComponentTaskContext setLastTaskType(ComponentTaskType lastTaskType)
public ComponentTaskContext addToContext(Object componentKey) throws CyclicDependencyException
addToContext(Object, ComponentTaskType) with the lastTaskType as typeCyclicDependencyExceptionpublic ComponentTaskContext addToContext(Object componentKey, ComponentTaskType type) throws CyclicDependencyException
ComponentTaskContext based on the given dependency and the
already registered ones. If the dependency has already been registered
a CyclicDependencyException will be thrown.CyclicDependencyExceptionpublic void checkDependency(Object componentKey, ComponentTaskType type) throws CyclicDependencyException
CyclicDependencyException
will be thrown.CyclicDependencyExceptionpublic boolean isLast(Object componentKey)
true if the dependency is the last, false otherwise.public boolean isRoot()
public <T> ConcurrentContainer.CreationalContextComponentAdapter<T> addComponentToContext(Object key, ConcurrentContainer.CreationalContextComponentAdapter<T> ctx)
CreationalContext of the component corresponding to the given key, to the dependency resolution
contextkey - The key of the component to add to the contextctx - The CreationalContext of the component to add to the contextConcurrentContainer.CreationalContextComponentAdapter instance that has been put into the mappublic ConcurrentContainer.CreationalContextComponentAdapter<?> removeComponentFromContext(Object key)
CreationalContext of the component corresponding to the given key, from the dependency resolution
contextkey - The key of the component to remove from the contextpublic <T> T getComponentInstanceFromContext(Object key, Class<T> bindType)
null is returnedpublic ComponentTaskContext resetDependencies(Object key, ComponentTaskType type)
key - the key of the new first dependencytype - the type of the corresponding taskComponentTaskContext instance with the dependencies resetedCopyright © 2015 eXo Platform SAS. All Rights Reserved.