org.apache.myfaces.shared_tomahawk.context
Class SwitchAjaxExceptionHandlerWrapperImpl

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

public class SwitchAjaxExceptionHandlerWrapperImpl
extends javax.faces.context.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(javax.faces.context.ExceptionHandler requestExceptionHandler, javax.faces.context.ExceptionHandler ajaxExceptionHandler)
           
 
Method Summary
 javax.faces.context.ExceptionHandler getWrapped()
           
protected  boolean isAjaxRequest()
           
protected  boolean isAjaxRequest(javax.faces.context.FacesContext facesContext)
           
protected  boolean isAjaxRequest(javax.faces.event.SystemEvent exceptionQueuedEvent)
           
 void processEvent(javax.faces.event.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(javax.faces.context.ExceptionHandler requestExceptionHandler,
                                             javax.faces.context.ExceptionHandler ajaxExceptionHandler)
Method Detail

processEvent

public void processEvent(javax.faces.event.SystemEvent exceptionQueuedEvent)
                  throws javax.faces.event.AbortProcessingException
Specified by:
processEvent in interface javax.faces.event.SystemEventListener
Overrides:
processEvent in class javax.faces.context.ExceptionHandlerWrapper
Throws:
javax.faces.event.AbortProcessingException

isAjaxRequest

protected boolean isAjaxRequest(javax.faces.event.SystemEvent exceptionQueuedEvent)

isAjaxRequest

protected boolean isAjaxRequest(javax.faces.context.FacesContext facesContext)

isAjaxRequest

protected boolean isAjaxRequest()

getWrapped

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


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