Class ExceptionQueuedEventContext
- java.lang.Object
- 
- jakarta.faces.event.ExceptionQueuedEventContext
 
- 
- All Implemented Interfaces:
- SystemEventListenerHolder
 
 public class ExceptionQueuedEventContext extends Object implements SystemEventListenerHolder This helper class provides context to the ExceptionQueuedEventregarding the state of the system at the point in time when theExceptionQueuedEventoccurs and links theExceptionQueuedEventto theExceptionHandlerby virtue of implementingSystemEventListener.- Since:
- 2.0
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringIN_AFTER_PHASE_KEYThe presence of an entry under this key in theMapreturned fromgetAttributes()indicates the event occurred during the “after phase” part of the current lifecycle phase.static StringIN_BEFORE_PHASE_KEYThe presence of an entry under this key in theMapreturned fromgetAttributes()indicates the event occurred during the “before phase” part of the current lifecycle phase.
 - 
Constructor SummaryConstructors Constructor Description ExceptionQueuedEventContext(FacesContext context, Throwable thrown)Instantiate a newExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred.ExceptionQueuedEventContext(FacesContext context, Throwable thrown, UIComponent component)Instantiate a newExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred, relevant to the argumentcomponent.ExceptionQueuedEventContext(FacesContext context, Throwable thrown, UIComponent component, PhaseId phaseId)Instantiate a newExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred, relevant to the argumentcomponent, during the lifecycle phasephaseId.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Object,Object>getAttributes()AMapof attributes relevant to the context of thisExceptionQueuedEvent.UIComponentgetComponent()Return theUIComponentwhich was being processed when the exception was thrown.FacesContextgetContext()TheFacesContextfor this request.ThrowablegetException()Return theexceptionproperty.List<SystemEventListener>getListenersForEventClass(Class<? extends SystemEvent> facesEventClass)Return aListthat contains a single entry, theExceptionHandlerfor the current request.PhaseIdgetPhaseId()Return thePhaseIdwhich was being processed when the exception was thrown.booleaninAfterPhase()booleaninBeforePhase()
 
- 
- 
- 
Field Detail- 
IN_BEFORE_PHASE_KEYpublic static final String IN_BEFORE_PHASE_KEY The presence of an entry under this key in the Mapreturned fromgetAttributes()indicates the event occurred during the “before phase” part of the current lifecycle phase.
 - 
IN_AFTER_PHASE_KEYpublic static final String IN_AFTER_PHASE_KEY The presence of an entry under this key in the Mapreturned fromgetAttributes()indicates the event occurred during the “after phase” part of the current lifecycle phase.
 
- 
 - 
Constructor Detail- 
ExceptionQueuedEventContextpublic ExceptionQueuedEventContext(FacesContext context, Throwable thrown) Instantiate a new ExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred.- Parameters:
- context-- FacesContextfor the current request
- thrown- the- Throwablethat is the context for this- ExceptionQueuedEventContextinstance.
 
 - 
ExceptionQueuedEventContextpublic ExceptionQueuedEventContext(FacesContext context, Throwable thrown, UIComponent component) Instantiate a new ExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred, relevant to the argumentcomponent.- Parameters:
- context-- FacesContextfor the current request
- thrown- the- Throwablethat is the context for this- ExceptionQueuedEventContextinstance.
- component- the- UIComponentinstance to which this- ExceptionQueuedEventContextpertains
 
 - 
ExceptionQueuedEventContextpublic ExceptionQueuedEventContext(FacesContext context, Throwable thrown, UIComponent component, PhaseId phaseId) Instantiate a new ExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred, relevant to the argumentcomponent, during the lifecycle phasephaseId.- Parameters:
- context-- FacesContextfor the current request
- thrown- the- Throwablethat is the context for this- ExceptionQueuedEventContextinstance.
- component- the- UIComponentthat is relevant to the context.
- phaseId- the- PhaseIdat the time this- ExeceptionEventContextis created.
 
 
- 
 - 
Method Detail- 
getContextpublic FacesContext getContext() The FacesContextfor this request.- Returns:
- the FacesContextused to create thisExceptionQueuedEventContextinstance.
 
 - 
getExceptionpublic Throwable getException() Return the exceptionproperty.- Returns:
- the exception
 
 - 
getComponentpublic UIComponent getComponent() Return the UIComponentwhich was being processed when the exception was thrown. If none or not available, this will benull.- Returns:
- the component
 
 - 
getPhaseIdpublic PhaseId getPhaseId() Return the PhaseIdwhich was being processed when the exception was thrown. If none or not available, this will benull.- Returns:
- the phase id
 
 - 
inBeforePhasepublic boolean inBeforePhase() - Returns:
- trueif the exception occurred during the- before phaseprocessing for a particular lifecycle phase
 
 - 
inAfterPhasepublic boolean inAfterPhase() - Returns:
- trueif the exception occurred during the- after phaseprocessing for a particular lifecycle phase
 
 - 
getAttributespublic Map<Object,Object> getAttributes() A Mapof attributes relevant to the context of thisExceptionQueuedEvent.- Returns:
- attributes related to this context
 
 - 
getListenersForEventClasspublic List<SystemEventListener> getListenersForEventClass(Class<? extends SystemEvent> facesEventClass) Return a Listthat contains a single entry, theExceptionHandlerfor the current request.- Specified by:
- getListenersForEventClassin interface- SystemEventListenerHolder
- Parameters:
- facesEventClass- the class for which listeners are to be returned
- Returns:
- the listeners for the argument class
 
 
- 
 
-