org.apache.myfaces.shared.context
Class SwitchAjaxExceptionHandlerWrapperImpl

java.lang.Object
  extended by javax.faces.context.ExceptionHandler
      extended by javax.faces.context.ExceptionHandlerWrapper
          extended by org.apache.myfaces.shared.context.SwitchAjaxExceptionHandlerWrapperImpl
All Implemented Interfaces:
EventListener, FacesListener, SystemEventListener, FacesWrapper<ExceptionHandler>

public class SwitchAjaxExceptionHandlerWrapperImpl
extends ExceptionHandlerWrapper

This wrapper is a switch to choose in a lazy way between ajax and normal exceptionHandler wrapping, because FacesContext is initialized after ExceptionHandler, so it is not safe to get it when ExceptionHandlerFactory.getExceptionHandler() is called.

Author:
Leonardo Uribe

Constructor Summary
SwitchAjaxExceptionHandlerWrapperImpl(ExceptionHandler requestExceptionHandler, ExceptionHandler ajaxExceptionHandler)
           
 
Method Summary
 ExceptionHandler getWrapped()
           
protected  boolean isAjaxRequest()
           
protected  boolean isAjaxRequest(FacesContext facesContext)
           
protected  boolean isAjaxRequest(SystemEvent exceptionQueuedEvent)
           
 void processEvent(SystemEvent exceptionQueuedEvent)
           
 
Methods inherited from class javax.faces.context.ExceptionHandlerWrapper
getHandledExceptionQueuedEvent, getHandledExceptionQueuedEvents, getRootCause, getUnhandledExceptionQueuedEvents, handle, isListenerForSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitchAjaxExceptionHandlerWrapperImpl

public SwitchAjaxExceptionHandlerWrapperImpl(ExceptionHandler requestExceptionHandler,
                                             ExceptionHandler ajaxExceptionHandler)
Method Detail

processEvent

public void processEvent(SystemEvent exceptionQueuedEvent)
                  throws AbortProcessingException
Specified by:
processEvent in interface SystemEventListener
Overrides:
processEvent in class ExceptionHandlerWrapper
Throws:
AbortProcessingException

isAjaxRequest

protected boolean isAjaxRequest(SystemEvent exceptionQueuedEvent)

isAjaxRequest

protected boolean isAjaxRequest(FacesContext facesContext)

isAjaxRequest

protected boolean isAjaxRequest()

getWrapped

public ExceptionHandler getWrapped()
Specified by:
getWrapped in interface FacesWrapper<ExceptionHandler>
Overrides:
getWrapped in class ExceptionHandlerWrapper


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.