public abstract class DoableContextChange extends ApplicationContextChange
suspend
, resume
and undoChange
will throw IllegalStateExceptions until the DoableContextChange is initialized by calling doChange()
This calls takes care of tracking the valid states so that doChange() or undoChange() are never called multiple times back-to-back.
Constructor and Description |
---|
DoableContextChange() |
Modifier and Type | Method and Description |
---|---|
void |
doChange(javax.faces.context.FacesContext context)
Apply the change.
|
protected abstract void |
doChangeImpl(javax.faces.context.FacesContext context)
Implementation of code to apply the change
|
void |
resume(javax.faces.context.FacesContext context)
Resume a currently suspended context change.
|
void |
suspend(javax.faces.context.FacesContext context)
Suspend the context change and revert back to the application context that existed before this context change was originally made.
|
void |
undoChange(javax.faces.context.FacesContext context)
Undo the change.
|
protected abstract void |
undoChangeImpl(javax.faces.context.FacesContext context)
Implementation of code to undo the change
|
public final void suspend(javax.faces.context.FacesContext context) throws IllegalStateException
It's only valid to suspend a context change that's currently active. The implementation of this method does not need to support a call to suspend a context change that's already suspended.
suspend
in class ApplicationContextChange
context
- the FacesContext
for the current request.IllegalStateException
- if the context change is already suspended or was never initializedpublic final void resume(javax.faces.context.FacesContext context) throws IllegalStateException
resume
in class ApplicationContextChange
context
- the FacesContext
for the current request.IllegalStateException
- if the context change is not currently suspended or initialized,public final void doChange(javax.faces.context.FacesContext context) throws IllegalStateException
context
- Current FacesContextIllegalStateException
- if called on a suspended changepublic final void undoChange(javax.faces.context.FacesContext context)
context
- Current FacesContextIllegalStateException
- if called on a suspended or uninitialized changeprotected abstract void doChangeImpl(javax.faces.context.FacesContext context)
context
- Current FacesContextprotected abstract void undoChangeImpl(javax.faces.context.FacesContext context)
context
- Current FacesContext