eXo Kernel :: Container 2.4.4-CLD

org.exoplatform.container.component
Class RequestLifeCycle

java.lang.Object
  extended by org.exoplatform.container.component.RequestLifeCycle

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.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
RequestLifeCycle(ExoContainer container, List<ComponentRequestLifecycle> components)
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestLifeCycle

public RequestLifeCycle(ExoContainer container,
                        List<ComponentRequestLifecycle> components)
Method Detail

begin

public static void begin(ExoContainer container,
                         boolean local)
Starts the life cycle of the provided container and add it to the life cycle stack. Only the components of the container that have not been previously enrolled in a life cycle are begun.

Parameters:
container - the container to use
local - will only trigger life cycle for the container and not its ancestors

begin

public static void begin(ComponentRequestLifecycle lifeCycle)
Starts the life cycle of the provided life cycle and add it to the life cycle stack. If the life cycle has already been triggered before then no operation will be really performed. When the life cycle is called, the argument container will be null.

Parameters:
lifeCycle - the life cycle

begin

public static void begin(ExoContainer container)
Starts the life cycle of the provided container and add it to the life cycle stack. Only the components of the container that have not been previously enrolled in a life cycle are begun.

Parameters:
container - the container to use

end

public 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.

Returns:
the result map
Throws:
IllegalStateException - if no container life cycle is associated with this thread

eXo Kernel :: Container 2.4.4-CLD

Copyright © 2013 eXo Platform SAS. All Rights Reserved.