org.springframework.richclient.exceptionhandling.delegation
Class AbstractExceptionHandlerDelegate

java.lang.Object
  extended by org.springframework.richclient.exceptionhandling.delegation.AbstractExceptionHandlerDelegate
All Implemented Interfaces:
Thread.UncaughtExceptionHandler, ExceptionHandlerDelegate
Direct Known Subclasses:
ChainInspectingExceptionHandlerDelegate, SimpleExceptionHandlerDelegate

public abstract class AbstractExceptionHandlerDelegate
extends Object
implements ExceptionHandlerDelegate

Superclass for delegate implementations

Since:
0.3.0
Author:
Geoffrey De Smet

Field Summary
protected  Thread.UncaughtExceptionHandler exceptionHandler
           
protected  ExceptionPurger exceptionPurger
           
protected  boolean purgeOnAppropriateCheck
           
protected  boolean purgeOnHandling
           
 
Constructor Summary
AbstractExceptionHandlerDelegate()
           
AbstractExceptionHandlerDelegate(Thread.UncaughtExceptionHandler exceptionHandler)
           
 
Method Summary
 boolean hasAppropriateHandler(Throwable throwable)
          Checks if the delegate wants to handle the throwable.
abstract  boolean hasAppropriateHandlerPurged(Throwable throwable)
           
 void setExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler)
           
 void setExceptionPurger(ExceptionPurger exceptionPurger)
          If set the throwable will first be purged before doing the approriate check or handling it.
 void setPurgeOnAppropriateCheck(boolean purgeOnAppropriateCheck)
           
 void setPurgeOnHandling(boolean purgeOnHandling)
           
 void uncaughtException(Thread thread, Throwable throwable)
          
 void uncaughtExceptionPurged(Thread thread, Throwable throwable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exceptionHandler

protected Thread.UncaughtExceptionHandler exceptionHandler

exceptionPurger

protected ExceptionPurger exceptionPurger

purgeOnAppropriateCheck

protected boolean purgeOnAppropriateCheck

purgeOnHandling

protected boolean purgeOnHandling
Constructor Detail

AbstractExceptionHandlerDelegate

public AbstractExceptionHandlerDelegate()

AbstractExceptionHandlerDelegate

public AbstractExceptionHandlerDelegate(Thread.UncaughtExceptionHandler exceptionHandler)
Method Detail

setExceptionHandler

public void setExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler)

setExceptionPurger

public void setExceptionPurger(ExceptionPurger exceptionPurger)
If set the throwable will first be purged before doing the approriate check or handling it.

Parameters:
exceptionPurger -

setPurgeOnAppropriateCheck

public void setPurgeOnAppropriateCheck(boolean purgeOnAppropriateCheck)

setPurgeOnHandling

public void setPurgeOnHandling(boolean purgeOnHandling)

hasAppropriateHandler

public final boolean hasAppropriateHandler(Throwable throwable)
Checks if the delegate wants to handle the throwable.

Specified by:
hasAppropriateHandler in interface ExceptionHandlerDelegate
Parameters:
throwable - the thrown exception or error.
Returns:
true if this exception handler wants to handle the throwable.

hasAppropriateHandlerPurged

public abstract boolean hasAppropriateHandlerPurged(Throwable throwable)

uncaughtException

public final void uncaughtException(Thread thread,
                                    Throwable throwable)

Specified by:
uncaughtException in interface Thread.UncaughtExceptionHandler

uncaughtExceptionPurged

public void uncaughtExceptionPurged(Thread thread,
                                    Throwable throwable)


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.