public abstract class ComponentContextManager extends Object
UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback)
or
UIComponent.visitTree(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback)
call in the proper context.
This functionality allows changes that only should apply when a component is currently processing its lifecycle to be temporarily suspended. For example, a component that alters the EL context should undo and changes when the component is not processing. An example of this is the Trinidad table that injects "var" and "varStatus" variables into the EL context while the table is iterating. By saving off these variables and restoring them, the EL will be correct should code perform an invoke on component or visit tree call, reentering the component tree from the view root.
The changes are automatically suspended during an invoke on component or visit tree invocation. This work is performed by the trh:head, trh:body and the tr:document components. Components outside of these components are not restore to the root context.
Constructor and Description |
---|
ComponentContextManager() |
Modifier and Type | Method and Description |
---|---|
abstract SuspendedContextChanges |
partialSuspend(javax.faces.context.FacesContext facesContext,
SuspendCallback callback)
Suspend the changes on the stack to an arbitrary point.
|
abstract ComponentContextChange |
peekChange()
Get the latest change on the stack without removing it.
|
abstract ComponentContextChange |
popChange()
Remove the latest change from the stack.
|
abstract void |
pushChange(ComponentContextChange change)
Push a change onto the stack.
|
abstract Iterator<ComponentContextChange> |
resume(javax.faces.context.FacesContext facesContext,
SuspendedContextChanges suspendedChanges)
Resume a set of suspended changes.
|
abstract SuspendedContextChanges |
suspend(javax.faces.context.FacesContext facesContext)
Suspend the entire stack of context changes.
|
public abstract void pushChange(ComponentContextChange change)
change
- The change to pushpublic abstract ComponentContextChange popChange() throws IllegalStateException
IllegalStateException
- if an attempt is made to pop an empty stackpublic abstract ComponentContextChange peekChange()
public abstract SuspendedContextChanges suspend(javax.faces.context.FacesContext facesContext)
facesContext
- The faces contextresume(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.SuspendedContextChanges)
method to resume the suspend
changes at a later timepublic abstract SuspendedContextChanges partialSuspend(javax.faces.context.FacesContext facesContext, SuspendCallback callback)
facesContext
- the faces contextcallback
- a callback interface used to determine how far back to suspend.resume(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.context.SuspendedContextChanges)
method to resume the suspend
changes at a later timepublic abstract Iterator<ComponentContextChange> resume(javax.faces.context.FacesContext facesContext, SuspendedContextChanges suspendedChanges)
facesContext
- the faces contextsuspendedChanges
- a set of changes that have been previously suspendedCopyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.