|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidad.context.ComponentContextManager
public abstract class ComponentContextManager
Interface that controls access to the stack of component context changes. This class
allows components to push changes onto a stack that must be rolled back in order to perform
an 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 Summary | |
---|---|
ComponentContextManager()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentContextManager()
Method Detail |
---|
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 context
resume(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 suspended
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |