Class ExceptionHandlerImpl
- All Implemented Interfaces:
FacesListener
,SystemEventListener
,EventListener
The default implementation of ExceptionHandler
for Faces.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the firstExceptionQueuedEvent
handled by this handler.The default implementation must return anIterable
over allExceptionQueuedEvent
s that have been handled by theExceptionHandler.handle()
method.Unwrap the argumentt
until the unwrapping encounters an Object whosegetClass()
is not equal toFacesException.class
orjakarta.el.ELException.class
.Return anIterable
over allExceptionQueuedEvent
s that have not yet been handled by theExceptionHandler.handle()
method.void
handle()
Take action to handle theException
instances residing inside theExceptionQueuedEvent
instances that have been queued by calls toApplication().publishEvent(ExceptionQueuedEvent.class, eventContext)
.boolean
isListenerForSource
(Object source) This method must returntrue
if and only if this listener instance is interested in receiving events from the instance referenced by thesource
parameter.void
processEvent
(SystemEvent event) When called, the listener can assume that any guarantees given in the javadoc for the specificSystemEvent
subclass are true.
-
Field Details
-
INCIDENT_ERROR
-
-
Constructor Details
-
ExceptionHandlerImpl
public ExceptionHandlerImpl() -
ExceptionHandlerImpl
public ExceptionHandlerImpl(boolean errorPagePresent)
-
-
Method Details
-
getHandledExceptionQueuedEvent
Description copied from class:ExceptionHandler
Return the first
ExceptionQueuedEvent
handled by this handler.- Specified by:
getHandledExceptionQueuedEvent
in classExceptionHandler
- Returns:
- instance of
ExceptionQueuedEvent
.
-
handle
Description copied from class:ExceptionHandler
Take action to handle the
Exception
instances residing inside theExceptionQueuedEvent
instances 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:
handle
in classExceptionHandler
- Throws:
FacesException
- if and only if a problem occurs while performing the algorithm to handle theException
, not as a means of conveying a handledException
itself.- See Also:
-
isListenerForSource
Description copied from class:ExceptionHandler
This method must return
true
if and only if this listener instance is interested in receiving events from the instance referenced by thesource
parameter.- Specified by:
isListenerForSource
in interfaceSystemEventListener
- Specified by:
isListenerForSource
in 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:
-
processEvent
Description copied from class:ExceptionHandler
When called, the listener can assume that any guarantees given in the javadoc for the specific
SystemEvent
subclass are true.- Specified by:
processEvent
in interfaceSystemEventListener
- Specified by:
processEvent
in classExceptionHandler
- Parameters:
event
- theSystemEvent
instance that is being processed.- Throws:
AbortProcessingException
- if lifecycle processing should cease for this request.- See Also:
-
getRootCause
Description copied from class:ExceptionHandler
Unwrap the argument
t
until the unwrapping encounters an Object whosegetClass()
is not equal toFacesException.class
orjakarta.el.ELException.class
. If there is no root cause,null
is returned.- Specified by:
getRootCause
in classExceptionHandler
- Parameters:
t
- passed-in wrappedThrowable
.- Returns:
- unwrapped object.
- See Also:
-
getUnhandledExceptionQueuedEvents
Description copied from class:ExceptionHandler
Return an
Iterable
over allExceptionQueuedEvent
s that have not yet been handled by theExceptionHandler.handle()
method.- Specified by:
getUnhandledExceptionQueuedEvents
in classExceptionHandler
- Returns:
- the unhandled set of
ExceptionQueuedEvent
s. - See Also:
-
getHandledExceptionQueuedEvents
Description copied from class:ExceptionHandler
The default implementation must return an
Iterable
over allExceptionQueuedEvent
s that have been handled by theExceptionHandler.handle()
method.- Specified by:
getHandledExceptionQueuedEvents
in classExceptionHandler
- Returns:
- an
Iterable
over allExceptionQueuedEvent
s. - See Also:
-