Class ExceptionQueuedEventContext
- java.lang.Object
-
- javax.faces.event.ExceptionQueuedEventContext
-
- All Implemented Interfaces:
SystemEventListenerHolder
public class ExceptionQueuedEventContext extends java.lang.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 Summary
Fields Modifier and Type Field Description static java.lang.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 java.lang.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 Summary
Constructors Constructor Description ExceptionQueuedEventContext(FacesContext context, java.lang.Throwable thrown)Instantiate a newExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred.ExceptionQueuedEventContext(FacesContext context, java.lang.Throwable thrown, UIComponent component)Instantiate a newExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred, relevant to the argumentcomponent.ExceptionQueuedEventContext(FacesContext context, java.lang.Throwable thrown, UIComponent component, PhaseId phaseId)Instantiate a newExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred, relevant to the argumentcomponent, during the lifecycle phasephaseId.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.Object,java.lang.Object>getAttributes()AMapof attributes relevant to the context of thisExceptionQueuedEvent.UIComponentgetComponent()Return theUIComponentwhich was being processed when the exception was thrown.FacesContextgetContext()java.lang.ThrowablegetException()Return theexceptionproperty.java.util.List<SystemEventListener>getListenersForEventClass(java.lang.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_KEY
public static final java.lang.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_KEY
public static final java.lang.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
-
ExceptionQueuedEventContext
public ExceptionQueuedEventContext(FacesContext context, java.lang.Throwable thrown)
Instantiate a new
ExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred.- Parameters:
context-FacesContextfor the current requestthrown- theThrowablethat is the context for thisExceptionQueuedEventContextinstance.
-
ExceptionQueuedEventContext
public ExceptionQueuedEventContext(FacesContext context, java.lang.Throwable thrown, UIComponent component)
Instantiate a new
ExceptionQueuedEventContextthat indicates the argumentThrowablejust occurred, relevant to the argumentcomponent.- Parameters:
context-FacesContextfor the current requestthrown- theThrowablethat is the context for thisExceptionQueuedEventContextinstance.component- theUIComponentinstance to which thisExceptionQueuedEventContextpertains
-
ExceptionQueuedEventContext
public ExceptionQueuedEventContext(FacesContext context, java.lang.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 requestthrown- theThrowablethat is the context for thisExceptionQueuedEventContextinstance.component- theUIComponentthat is relevant to the context.phaseId- thePhaseIdat the time thisExeceptionEventContextis created.
-
-
Method Detail
-
getContext
public FacesContext getContext()
- Returns:
- the
FacesContextused to create thisExceptionQueuedEventContextinstance.
-
getException
public java.lang.Throwable getException()
Return the
exceptionproperty.
-
getComponent
public UIComponent getComponent()
Return the
UIComponentwhich was being processed when the exception was thrown. If none or not available, this will benull.
-
getPhaseId
public PhaseId getPhaseId()
Return the
PhaseIdwhich was being processed when the exception was thrown. If none or not available, this will benull.
-
inBeforePhase
public boolean inBeforePhase()
- Returns:
trueif the exception occurred during thebefore phaseprocessing for a particular lifecycle phase
-
inAfterPhase
public boolean inAfterPhase()
- Returns:
trueif the exception occurred during theafter phaseprocessing for a particular lifecycle phase
-
getAttributes
public java.util.Map<java.lang.Object,java.lang.Object> getAttributes()
A
Mapof attributes relevant to the context of thisExceptionQueuedEvent.
-
getListenersForEventClass
public java.util.List<SystemEventListener> getListenersForEventClass(java.lang.Class<? extends SystemEvent> facesEventClass)
Return a
Listthat contains a single entry, theExceptionHandlerfor the current request.- Specified by:
getListenersForEventClassin interfaceSystemEventListenerHolder
-
-