Oracle Fusion Middleware Java API Reference for Oracle ADF Lifecycle
11g Release 1 (11.1.1.7.0)

E10652-08

oracle.adf.controller.v2.context
Class LifecycleContext

java.lang.Object
  extended by oracle.adf.controller.v2.context.LifecycleContext
Direct Known Subclasses:
PageLifecycleContext

public class LifecycleContext
extends java.lang.Object

LifecycleContext is the base class for all context classes used in the ADF Lifecycle. It contains all the state information that will be kept during the execution of the ADF Lifecycle. It is passed as a parameter of each phase execution.

This context object lives for the duration of the current Lifecycle.

Since:
10.1.3

Field Summary
protected  java.util.Map envMap
          The map used to store the context.
static java.lang.String PAGE_LIFECYCLE_KEY
          Key used to store the PageLifecycle instance in the context map.
protected static java.lang.String PATH_KEY
           
 
Constructor Summary
  LifecycleContext(java.util.Map envMap)
          Constructor with the environment Map to use for the context.
protected LifecycleContext(java.util.Map envMap, boolean initController)
          Constructor with the environment Map to use for the context and a boolean to specify is the Controller Class should be initialized.
 
Method Summary
 oracle.adf.model.RegionBinding getBindingContainer()
          Retrieve the RegionBinding instance for the current page.
 oracle.adf.model.BindingContext getBindingContext()
          Retrieve the BindingContext object for the current session.
static LifecycleContext getCurrentInstance()
          Return the current instance of the LifecycleContext.
 oracle.adf.share.Environment getEnvironment()
          Retrieve the anonymous environment.
static LifecycleContext getInstance(java.util.Map envMap)
          Instanciate the LifecycleContext associated with a PageLifecycle.
static LifecycleContext getInstance(java.util.Map envMap, PageLifecycle lifecycle)
          Instanciate the LifecycleContext associated with a PageLifecycle.
 PageLifecycle getPageController()
          Retrieve the PageController from the context map.
 PageLifecycle getPageLifecycle()
          Retrieve the PageLifecycle object from the context map.
 PagePhaseListener getPagePhaseListener()
          Retrieve the PagePhaseListener from the context map.
protected  java.lang.String getPath()
          Retrieve the path info for the current page.
 boolean getPrepareRender()
          Return true if the prepareRender method has been called.
protected  void initControllerClass()
          Initialize the PageController instance that will be used during this PageLifecycle.
 void prepareRender()
          Indicate to the Lifecycle that the next phase to be executed should be PREPARE_RENDER, by-passing any other phase left in the lifecycle.
 void resetControllerClass()
          Calls initControllerClass() with public access.
 void setPageController(PageLifecycle lifeCycle)
          Store the PageController Object in the Lifecycle context map.
 void setPageLifecycle(PageLifecycle lifeCycle)
          Store a PageLifecycle object in the context map.
 void setPagePhaseListener(PagePhaseListener pagePhaseListener)
          Store the PagePhaseListener Object in the Lifecycle context map.
 void setPath(java.lang.String path)
          Store the path for the current page in the context map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

envMap

protected final java.util.Map envMap
The map used to store the context.


PAGE_LIFECYCLE_KEY

public static final java.lang.String PAGE_LIFECYCLE_KEY
Key used to store the PageLifecycle instance in the context map.

See Also:
Constant Field Values

PATH_KEY

protected static final java.lang.String PATH_KEY
See Also:
Constant Field Values
Constructor Detail

LifecycleContext

public LifecycleContext(java.util.Map envMap)
Constructor with the environment Map to use for the context.

Parameters:
envMap - a Map to the environment.

LifecycleContext

protected LifecycleContext(java.util.Map envMap,
                           boolean initController)
Constructor with the environment Map to use for the context and a boolean to specify is the Controller Class should be initialized.

Parameters:
envMap - a Map to the environment.
initController - true if the Controller class should be initialized.
Method Detail

getInstance

public static LifecycleContext getInstance(java.util.Map envMap)
                                    throws java.lang.Exception
Instanciate the LifecycleContext associated with a PageLifecycle. The PageLifecycle is stored in the map using the PAGE_LIFECYCLE_KEY key.

Parameters:
envMap - map containing the lifecycle object
Returns:
the LifecycleContext
Throws:
java.lang.Exception

getInstance

public static LifecycleContext getInstance(java.util.Map envMap,
                                           PageLifecycle lifecycle)
                                    throws java.lang.Exception
Instanciate the LifecycleContext associated with a PageLifecycle. The LifecycleContext class to instanciate is retrieve from the Lifecycle using getLifecycleContextClass().

Parameters:
envMap - The map of properties that will be used to initialize the context.
lifecycle - The PageLifecycle instance.
Returns:
the LifecycleContext
Throws:
java.lang.Exception

getCurrentInstance

public static LifecycleContext getCurrentInstance()
Return the current instance of the LifecycleContext. This method will throw a ControllerException if the context does not exist.

Returns:
the LifecycleContext.

getEnvironment

public oracle.adf.share.Environment getEnvironment()
Retrieve the anonymous environment. Simply delegate to the ADFContext routine.

See Also:
ADFContext.getEnvironment()

getBindingContext

public oracle.adf.model.BindingContext getBindingContext()
Retrieve the BindingContext object for the current session.


getBindingContainer

public oracle.adf.model.RegionBinding getBindingContainer()
Retrieve the RegionBinding instance for the current page.


getPath

protected java.lang.String getPath()
Retrieve the path info for the current page. Currently using the pathInfo or the servletPath from the request.

Returns:
the path for the current page.

setPath

public void setPath(java.lang.String path)
Store the path for the current page in the context map.

Parameters:
path - the path for the current page.

getPageLifecycle

public PageLifecycle getPageLifecycle()
Retrieve the PageLifecycle object from the context map.

Returns:
Lifecycle object in use for the current request.

setPageLifecycle

public void setPageLifecycle(PageLifecycle lifeCycle)
Store a PageLifecycle object in the context map.

Parameters:
lifeCycle - Lifecycle object to use for the current request.

getPageController

public PageLifecycle getPageController()
Retrieve the PageController from the context map.

Returns:
PageController object in use for the current request.

setPageController

public void setPageController(PageLifecycle lifeCycle)
Store the PageController Object in the Lifecycle context map.

Parameters:
lifeCycle - PageLifecycle object to use for the current request.

getPagePhaseListener

public PagePhaseListener getPagePhaseListener()
Retrieve the PagePhaseListener from the context map.

Returns:
PagePhaseListener object in use for the current request.

setPagePhaseListener

public void setPagePhaseListener(PagePhaseListener pagePhaseListener)
Store the PagePhaseListener Object in the Lifecycle context map.

Parameters:
pagePhaseListener - PagePhaseListener object to use for the current request.

getPrepareRender

public boolean getPrepareRender()

Return true if the prepareRender method has been called.


prepareRender

public void prepareRender()

Indicate to the Lifecycle that the next phase to be executed should be PREPARE_RENDER, by-passing any other phase left in the lifecycle.


resetControllerClass

public void resetControllerClass()
Calls initControllerClass() with public access. Use to reset the controller class if the current binding container change during the Lifecycle like when navigating.


initControllerClass

protected void initControllerClass()
Initialize the PageController instance that will be used during this PageLifecycle. First retrieve the instance, then store it in the context map. The object to use is specified using the ControllerClass property of the PageDefinition xml file. This object can be specified in one of two ways: If the ControllerClass property of the PageDefinition is empty or not of correct type, uses the default PageLifecycle for PageController. The PageController instance is stored in the context using PageController property. If the ControllerClass property is a PagePhaseListener, instanciate it and store it in the PagePhaseListener property of the context.


Oracle Fusion Middleware Java API Reference for Oracle ADF Lifecycle
11g Release 1 (11.1.1.7.0)

E10652-08

Copyright © 1997, 2013, Oracle. All rights reserved.