Top Description Inners Constructors Methods
javax.faces.webapp

public Class PreJsf2ExceptionHandlerFactory

extends ExceptionHandlerFactory
Class Inheritance
Imports
java.util.logging.Logger, .Level, java.util.LinkedList, .Collections, .Iterator, javax.faces.context.ExceptionHandlerFactory, .ExceptionHandler, .FacesContext, javax.faces.FacesException, javax.faces.component.UIComponent, .UpdateModelException, javax.faces.event.ExceptionQueuedEvent, .SystemEvent, .AbortProcessingException, .ExceptionQueuedEventContext, .PhaseId, javax.el.ELException, javax.faces.application.FacesMessage

This ExceptionHandlerFactory instance produces JSF 1.2 compatible ExceptionHandler instances. The ExceptionHandler#handle method of the ExceptionHandler produced by this factory must meet the following requirements

Since
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PreJsf2ExceptionHandlerFactory.PreJsf2ExceptionHandler

JSF 1.2-style ExceptionHandler implementation.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ExceptionHandler

Returns:

a new ExceptionHandler that behaves in a fashion compatible with specifications prior to JavaServerFaces 1.2
getExceptionHandler
()

Implements abstract javax.faces.context.ExceptionHandlerFactory.getExceptionHandler.

Create and return a A new ExceptionHandler instance.

Inherited from javax.faces.context.ExceptionHandlerFactory:
getWrapped

Constructor Detail

PreJsf2ExceptionHandlerFactoryback to summary
public PreJsf2ExceptionHandlerFactory()

Method Detail

getExceptionHandlerback to summary
public ExceptionHandler getExceptionHandler()

Implements abstract javax.faces.context.ExceptionHandlerFactory.getExceptionHandler.

Doc from javax.faces.context.ExceptionHandlerFactory.getExceptionHandler.

Create and return a A new ExceptionHandler instance. The implementation must return an ExceptionHandler instance suitable for the environment. For example, in some cases it may be desirable for an ExceptionHandler to write error information to the response instead of throwing exceptions as in the case of Ajax applications.

Returns:ExceptionHandler

a new ExceptionHandler that behaves in a fashion compatible with specifications prior to JavaServerFaces 1.2

Annotations
@Override
javax.faces.webapp back to summary

private final Class PreJsf2ExceptionHandlerFactory.PreJsf2ExceptionHandler

extends ExceptionHandler
Class Inheritance

JSF 1.2-style ExceptionHandler implementation.

Field Summary

Modifier and TypeField and Description
private ExceptionQueuedEvent
private LinkedList<ExceptionQueuedEvent>
private static final String
private static final String
private static final String
private static final Logger
private LinkedList<ExceptionQueuedEvent>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ExceptionQueuedEvent
getHandledExceptionQueuedEvent()

Implements abstract javax.faces.context.ExceptionHandler.getHandledExceptionQueuedEvent.

Return the first ExceptionQueuedEvent handled by this handler.

public Iterable<ExceptionQueuedEvent>
getHandledExceptionQueuedEvents()

Implements abstract javax.faces.context.ExceptionHandler.getHandledExceptionQueuedEvents.

The default implementation must return an Iterable over all ExceptionQueuedEvents that have been handled by the handle method.

private String
getLoggingKey(boolean beforePhase, boolean afterPhase)

public Throwable
getRootCause(Throwable
passed-in wrapped Throwable.
t
)

Implements abstract javax.faces.context.ExceptionHandler.getRootCause.

Unwrap the argument t until the unwrapping encounters an Object whose getClass() is not equal to FacesException.class or javax.el.ELException.class.

public Iterable<ExceptionQueuedEvent>
getUnhandledExceptionQueuedEvents()

Implements abstract javax.faces.context.ExceptionHandler.getUnhandledExceptionQueuedEvents.

Return an Iterable over all ExceptionQueuedEvents that have not yet been handled by the handle method.

public void
handle()

Implements abstract javax.faces.context.ExceptionHandler.handle.

Take action to handle the Exception instances residing inside the ExceptionQueuedEvent instances that have been queued by calls to Application().publishEvent(ExceptionQueuedEvent.class, eventContext).

public boolean
isListenerForSource(Object
the source that is inquiring about the appropriateness of sending an event to this listener instance.
source
)

Implements abstract javax.faces.context.ExceptionHandler.isListenerForSource.

Implements javax.faces.event.SystemEventListener.isListenerForSource.

This method must return true if and only if this listener instance is interested in receiving events from the instance referenced by the source parameter.

private boolean
isRethrown(Throwable t, boolean isBeforeOrAfterPhase)

private void
log(ExceptionQueuedEventContext exceptionContext)

public void
processEvent(SystemEvent
the SystemEvent instance that is being processed.
event
)

Implements abstract javax.faces.context.ExceptionHandler.processEvent.

Implements javax.faces.event.SystemEventListener.processEvent.

When called, the listener can assume that any guarantees given in the javadoc for the specific SystemEvent subclass are true.

private boolean

Returns:

true if c is FacesException.class or ELException.class
shouldUnwrap
(Class<? extends Throwable>
Throwable implementation class
c
)

Field Detail

handledback to summary
private ExceptionQueuedEvent handled
handledExceptionsback to summary
private LinkedList<ExceptionQueuedEvent> handledExceptions
LOG_AFTER_KEYback to summary
private static final String LOG_AFTER_KEY
LOG_BEFORE_KEYback to summary
private static final String LOG_BEFORE_KEY
LOG_KEYback to summary
private static final String LOG_KEY
LOGGERback to summary
private static final Logger LOGGER
unhandledExceptionsback to summary
private LinkedList<ExceptionQueuedEvent> unhandledExceptions

Constructor Detail

PreJsf2ExceptionHandlerback to summary
private PreJsf2ExceptionHandler()

Method Detail

getHandledExceptionQueuedEventback to summary
public ExceptionQueuedEvent getHandledExceptionQueuedEvent()

Implements abstract javax.faces.context.ExceptionHandler.getHandledExceptionQueuedEvent.

Doc from javax.faces.context.ExceptionHandler.getHandledExceptionQueuedEvent.

Return the first ExceptionQueuedEvent handled by this handler.

Returns:ExceptionQueuedEvent

instance of ExceptionQueuedEvent.

Annotations
@Override
See Also
ExceptionHandler@getHandledExceptionQueuedEvent()
getHandledExceptionQueuedEventsback to summary
public Iterable<ExceptionQueuedEvent> getHandledExceptionQueuedEvents()

Implements abstract javax.faces.context.ExceptionHandler.getHandledExceptionQueuedEvents.

Doc from javax.faces.context.ExceptionHandler.getHandledExceptionQueuedEvents.

The default implementation must return an Iterable over all ExceptionQueuedEvents that have been handled by the handle method.

Annotations
@Override
See Also
javax.faces.context.ExceptionHandler#getHandledExceptionQueuedEvents()
getLoggingKeyback to summary
private String getLoggingKey(boolean beforePhase, boolean afterPhase)
getRootCauseback to summary
public Throwable getRootCause(Throwable t)

Implements abstract javax.faces.context.ExceptionHandler.getRootCause.

Doc from javax.faces.context.ExceptionHandler.getRootCause.

Unwrap the argument t until the unwrapping encounters an Object whose getClass() is not equal to FacesException.class or javax.el.ELException.class. If there is no root cause, null is returned.

Parameters
t:Throwable

passed-in wrapped Throwable.

Returns:Throwable

unwrapped object.

Annotations
@Override
See Also
ExceptionHandler#getRootCause(Throwable)
getUnhandledExceptionQueuedEventsback to summary
public Iterable<ExceptionQueuedEvent> getUnhandledExceptionQueuedEvents()

Implements abstract javax.faces.context.ExceptionHandler.getUnhandledExceptionQueuedEvents.

Doc from javax.faces.context.ExceptionHandler.getUnhandledExceptionQueuedEvents.

Return an Iterable over all ExceptionQueuedEvents that have not yet been handled by the handle method.

Returns:Iterable<ExceptionQueuedEvent>

the unhandled set of ExceptionQueuedEvents.

Annotations
@Override
See Also
javax.faces.context.ExceptionHandler#getUnhandledExceptionQueuedEvents()
handleback to summary
public void handle() throws FacesException

Implements abstract javax.faces.context.ExceptionHandler.handle.

Doc from javax.faces.context.ExceptionHandler.handle.

Take action to handle the Exception instances residing inside the ExceptionQueuedEvent instances that have been queued by calls to Application().publishEvent(ExceptionQueuedEvent.class, eventContext). The requirements of the default implementation are detailed in section JSF.6.2.1.

Annotations
@Override
Exceptions
FacesException:
if and only if a problem occurs while performing the algorithm to handle the Exception, not as a means of conveying a handled Exception itself.
Since
2.0
isListenerForSourceback to summary
public boolean isListenerForSource(Object source)

Implements abstract javax.faces.context.ExceptionHandler.isListenerForSource.

Implements javax.faces.event.SystemEventListener.isListenerForSource.

Doc from javax.faces.context.ExceptionHandler.isListenerForSource.

This method must return true if and only if this listener instance is interested in receiving events from the instance referenced by the source parameter.

Parameters
source:Object

Doc from javax.faces.event.SystemEventListener.isListenerForSource.

the source that is inquiring about the appropriateness of sending an event to this listener instance.

Returns:boolean

Doc from javax.faces.event.SystemEventListener.isListenerForSource.

the value as specified above

Annotations
@Override
See Also
javax.faces.context.ExceptionHandler#isListenerForSource(Object)
isRethrownback to summary
private boolean isRethrown(Throwable t, boolean isBeforeOrAfterPhase)
logback to summary
private void log(ExceptionQueuedEventContext exceptionContext)
processEventback to summary
public void processEvent(SystemEvent event) throws AbortProcessingException

Implements abstract javax.faces.context.ExceptionHandler.processEvent.

Implements javax.faces.event.SystemEventListener.processEvent.

Doc from javax.faces.context.ExceptionHandler.processEvent.

When called, the listener can assume that any guarantees given in the javadoc for the specific SystemEvent subclass are true.

Parameters
event:SystemEvent

Doc from javax.faces.event.SystemEventListener.processEvent.

the SystemEvent instance that is being processed.

Annotations
@Override
Exceptions
AbortProcessingException:

Doc from javax.faces.event.SystemEventListener.processEvent.

if lifecycle processing should cease for this request.

See Also
javax.faces.context.ExceptionHandler#processEvent(javax.faces.event.SystemEvent)
shouldUnwrapback to summary
private boolean shouldUnwrap(Class<? extends Throwable> c)
Parameters
c:Class<? extends Throwable>

Throwable implementation class

Returns:boolean

true if c is FacesException.class or ELException.class