|
Oracle Fusion Middleware Java API Reference for Oracle ADF Faces 11g Release 1 (11.1.1) E10684-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.adf.view.rich.context.ApplicationContextManager
public abstract class ApplicationContextManager
ApplicationContextManager
is used to track changes to the runtime context of an ADF application during the request lifecycle. The series of changes that lead to the current application context are represented as a stack data structure.
Any time a change is made to the application context outside of component traversal during a JSF phase, a change object representing the change should be pushed onto the stack using the ApplicationContextManager
. For example, if a UI component modifies the application's context by changing how EL expressions get evaluated then the component implementation should push a context change onto the stack when the component becomes active and pop the change when the component is no longer active.
There are times when application code running in one contexts need to invoke code that executes in a different context. An example of this is the UIComponent.invokeOnComponent(FacesContext,String,ContextCallback)
method. To support these use cases the suspendContext(FacesContext)
and resumeContext(FacesContext,SuspendedContext)
methods may be used. The suspendContext(FacesContext)
suspends the current set of context changes and restores the original root context. A new context may then be established and application logic executed. Once the the application logic has completed the previous context may be restored using the resumeContext(FacesContext, SuspendedContext)
method.
Nested Class Summary | |
---|---|
static class |
ApplicationContextManager.SuspendedContext Opaque handle representing a set of suspended context changes. |
Constructor Summary | |
---|---|
ApplicationContextManager() |
Method Summary | |
---|---|
protected ApplicationContextManager.SuspendedContext |
createSuspendedContext(javax.faces.context.FacesContext context, java.util.Deque<ApplicationContextChange> stack) Creates a new suspended context |
abstract ApplicationContextChange |
peekContextChange() |
abstract ApplicationContextChange |
popContextChange() Pops the top context change off of the application context change stack. |
abstract void |
pushContextChange(ApplicationContextChange change) Pushes a new context change onto the application context change stack. |
abstract void |
resumeContext(javax.faces.context.FacesContext context, ApplicationContextManager.SuspendedContext suspendedContext) Resume a previously suspended set of context changes. |
protected java.util.Deque<ApplicationContextChange> |
resumeSuspendedContext(javax.faces.context.FacesContext facesContext, ApplicationContextManager.SuspendedContext suspendedContext) Resumes a suspended context |
abstract ApplicationContextManager.SuspendedContext |
suspendContext(javax.faces.context.FacesContext context) Suspends the current application context changes on the stack by calling ApplicationContextChange.suspend(FacesContext) on each stack entry, starting from the top of the stack and working down the stack to the root of the page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationContextManager()
Method Detail |
---|
public abstract void pushContextChange(ApplicationContextChange change)
change
- the change to be pushed.java.lang.NullPointerException
- if the change object is null
.public abstract ApplicationContextChange popContextChange() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if the stack is empty.public abstract ApplicationContextChange peekContextChange()
null
if the stack is empty.public abstract ApplicationContextManager.SuspendedContext suspendContext(javax.faces.context.FacesContext context)
ApplicationContextChange.suspend(FacesContext)
on each stack entry, starting from the top of the stack and working down the stack to the root of the page. This operation returns the application back to the root context that existed at the beginning of the current request lifecycle phase. The suspended context changes are remove from the stack so that the stack is empty when this method completes.context
- FacesContext.public abstract void resumeContext(javax.faces.context.FacesContext context, ApplicationContextManager.SuspendedContext suspendedContext) throws java.lang.IllegalStateException
Note: A set of suspended context changes may only be resumed once.
context
- FacesContext.suspendedContext
- the set of suspened contexts to resume.java.lang.IllegalStateException
- if the suspendedContext has already been resumed or if the current stack of context changes is not empty (i.e. the current context is not the page root).protected final ApplicationContextManager.SuspendedContext createSuspendedContext(javax.faces.context.FacesContext context, java.util.Deque<ApplicationContextChange> stack)
context
- the faces contextstack
- the stach of changesprotected final java.util.Deque<ApplicationContextChange> resumeSuspendedContext(javax.faces.context.FacesContext facesContext, ApplicationContextManager.SuspendedContext suspendedContext)
facesContext
- the faces contextsuspendedContext
- the suspended context
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Faces 11g Release 1 (11.1.1) E10684-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |