Class ExceptionHandlerImpl
- java.lang.Object
-
- jakarta.faces.context.ExceptionHandler
-
- com.sun.faces.context.ExceptionHandlerImpl
-
- All Implemented Interfaces:
FacesListener,SystemEventListener,EventListener
public class ExceptionHandlerImpl extends ExceptionHandler
The default implementation of
ExceptionHandlerfor Faces.
-
-
Field Summary
Fields Modifier and Type Field Description static LevelINCIDENT_ERROR
-
Constructor Summary
Constructors Constructor Description ExceptionHandlerImpl()ExceptionHandlerImpl(boolean errorPagePresent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExceptionQueuedEventgetHandledExceptionQueuedEvent()Return the firstExceptionQueuedEventhandled by this handler.Iterable<ExceptionQueuedEvent>getHandledExceptionQueuedEvents()The default implementation must return anIterableover allExceptionQueuedEvents that have been handled by theExceptionHandler.handle()method.ThrowablegetRootCause(Throwable t)Unwrap the argumenttuntil the unwrapping encounters an Object whosegetClass()is not equal toFacesException.classorjakarta.el.ELException.class.Iterable<ExceptionQueuedEvent>getUnhandledExceptionQueuedEvents()Return anIterableover allExceptionQueuedEvents that have not yet been handled by theExceptionHandler.handle()method.voidhandle()Take action to handle theExceptioninstances residing inside theExceptionQueuedEventinstances that have been queued by calls toApplication().publishEvent(ExceptionQueuedEvent.class, eventContext).booleanisListenerForSource(Object source)This method must returntrueif and only if this listener instance is interested in receiving events from the instance referenced by thesourceparameter.voidprocessEvent(SystemEvent event)When called, the listener can assume that any guarantees given in the javadoc for the specificSystemEventsubclass are true.
-
-
-
Field Detail
-
INCIDENT_ERROR
public static final Level INCIDENT_ERROR
-
-
Method Detail
-
getHandledExceptionQueuedEvent
public ExceptionQueuedEvent getHandledExceptionQueuedEvent()
Description copied from class:ExceptionHandlerReturn the first
ExceptionQueuedEventhandled by this handler.- Specified by:
getHandledExceptionQueuedEventin classExceptionHandler- Returns:
- instance of
ExceptionQueuedEvent.
-
handle
public void handle() throws FacesExceptionDescription copied from class:ExceptionHandlerTake action to handle the
Exceptioninstances residing inside theExceptionQueuedEventinstances that have been queued by calls toApplication().publishEvent(ExceptionQueuedEvent.class, eventContext). The requirements of the default implementation are detailed in section 6.2.1 "Default ExceptionHandler implementation" of the Jakarta Faces Specification Document.- Specified by:
handlein classExceptionHandler- Throws:
FacesException- if and only if a problem occurs while performing the algorithm to handle theException, not as a means of conveying a handledExceptionitself.- See Also:
ExceptionHandler.handle()
-
isListenerForSource
public boolean isListenerForSource(Object source)
Description copied from class:ExceptionHandlerThis method must return
trueif and only if this listener instance is interested in receiving events from the instance referenced by thesourceparameter.- Specified by:
isListenerForSourcein interfaceSystemEventListener- Specified by:
isListenerForSourcein classExceptionHandler- Parameters:
source- the source that is inquiring about the appropriateness of sending an event to this listener instance.- Returns:
- the value as specified above
- See Also:
ExceptionHandler.isListenerForSource(Object)
-
processEvent
public void processEvent(SystemEvent event) throws AbortProcessingException
Description copied from class:ExceptionHandlerWhen called, the listener can assume that any guarantees given in the javadoc for the specific
SystemEventsubclass are true.- Specified by:
processEventin interfaceSystemEventListener- Specified by:
processEventin classExceptionHandler- Parameters:
event- theSystemEventinstance that is being processed.- Throws:
AbortProcessingException- if lifecycle processing should cease for this request.- See Also:
ExceptionHandler.processEvent(jakarta.faces.event.SystemEvent)
-
getRootCause
public Throwable getRootCause(Throwable t)
Description copied from class:ExceptionHandlerUnwrap the argument
tuntil the unwrapping encounters an Object whosegetClass()is not equal toFacesException.classorjakarta.el.ELException.class. If there is no root cause,nullis returned.- Specified by:
getRootCausein classExceptionHandler- Parameters:
t- passed-in wrappedThrowable.- Returns:
- unwrapped object.
- See Also:
ExceptionHandler.getRootCause(Throwable)
-
getUnhandledExceptionQueuedEvents
public Iterable<ExceptionQueuedEvent> getUnhandledExceptionQueuedEvents()
Description copied from class:ExceptionHandlerReturn an
Iterableover allExceptionQueuedEvents that have not yet been handled by theExceptionHandler.handle()method.- Specified by:
getUnhandledExceptionQueuedEventsin classExceptionHandler- Returns:
- the unhandled set of
ExceptionQueuedEvents. - See Also:
ExceptionHandler.getUnhandledExceptionQueuedEvents()
-
getHandledExceptionQueuedEvents
public Iterable<ExceptionQueuedEvent> getHandledExceptionQueuedEvents()
Description copied from class:ExceptionHandlerThe default implementation must return an
Iterableover allExceptionQueuedEvents that have been handled by theExceptionHandler.handle()method.- Specified by:
getHandledExceptionQueuedEventsin classExceptionHandler- Returns:
- an
Iterableover allExceptionQueuedEvents. - See Also:
ExceptionHandler.getHandledExceptionQueuedEvents()
-
-