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.
Modifier and Type | Field and Description |
---|---|
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 |
Modifier | Constructor and Description |
---|---|
|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected final java.util.Map envMap
public static final java.lang.String PAGE_LIFECYCLE_KEY
protected static final java.lang.String PATH_KEY
public LifecycleContext(java.util.Map envMap)
envMap
- a Map to the environment.protected LifecycleContext(java.util.Map envMap, boolean initController)
envMap
- a Map to the environment.initController
- true if the Controller class should be initialized.public static LifecycleContext getInstance(java.util.Map envMap) throws java.lang.Exception
envMap
- map containing the lifecycle objectjava.lang.Exception
public static LifecycleContext getInstance(java.util.Map envMap, PageLifecycle lifecycle) throws java.lang.Exception
envMap
- The map of properties that will be used to initialize the
context.lifecycle
- The PageLifecycle instance.java.lang.Exception
public static LifecycleContext getCurrentInstance()
public oracle.adf.share.Environment getEnvironment()
ADFContext.getEnvironment()
public oracle.adf.model.BindingContext getBindingContext()
public oracle.adf.model.RegionBinding getBindingContainer()
protected java.lang.String getPath()
public void setPath(java.lang.String path)
path
- the path for the current page.public PageLifecycle getPageLifecycle()
public void setPageLifecycle(PageLifecycle lifeCycle)
lifeCycle
- Lifecycle object to use for the current request.public PageLifecycle getPageController()
public void setPageController(PageLifecycle lifeCycle)
lifeCycle
- PageLifecycle object to use for the current request.public PagePhaseListener getPagePhaseListener()
public void setPagePhaseListener(PagePhaseListener pagePhaseListener)
pagePhaseListener
- PagePhaseListener object to use for the current request.public boolean getPrepareRender()
Return true
if the prepareRender
method has been called.
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.
public void resetControllerClass()
initControllerClass()
with public access.
Use to reset the controller class if the current binding container change
during the Lifecycle like when navigating.protected void initControllerClass()
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:
PagePhaseListener
,
instanciate it and store it in the PagePhaseListener property of the context.