public class RequestLifeCycle extends Object
The request life cycle object allows a client to demarcate the life cycle of the various components associated with containers. It allows container stacking and guarantees that the life cycle of the components will never be called twice in the same stack.
| Constructor and Description |
|---|
RequestLifeCycle(ExoContainer container,
List<ComponentRequestLifecycle> components) |
| Modifier and Type | Method and Description |
|---|---|
static void |
begin(ComponentRequestLifecycle lifeCycle)
Starts the life cycle of the provided life cycle and add it to the life cycle stack.
|
static void |
begin(ExoContainer container)
Starts the life cycle of the provided container and add it to the life cycle stack.
|
static void |
begin(ExoContainer container,
boolean local)
Starts the life cycle of the provided container and add it to the life cycle stack.
|
static Map<Object,Throwable> |
end()
Ends the life cycle of the most recent container started.
|
public RequestLifeCycle(ExoContainer container, List<ComponentRequestLifecycle> components)
public static void begin(ExoContainer container, boolean local)
container - the container to uselocal - will only trigger life cycle for the container and not its ancestorspublic static void begin(ComponentRequestLifecycle lifeCycle)
lifeCycle - the life cyclepublic static void begin(ExoContainer container)
container - the container to usepublic static Map<Object,Throwable> end() throws IllegalStateException
Ends the life cycle of the most recent container started. Only the components of the container that have not been previously enrolled in a life cycle are ended.
The result map returned has for keys the components whose the life cycle ended during this method call and the associated value are the potential throwable that were thrown by those components. It is usefull when writing unit test to be aware of the throwable of the various components involved in a request life cycle.
IllegalStateException - if no container life cycle is associated with this threadCopyright © 2016 eXo Platform SAS. All Rights Reserved.