org.springframework.richclient.exceptionhandling
Class AbstractLoggingExceptionHandler

java.lang.Object
  extended by org.springframework.richclient.exceptionhandling.AbstractRegisterableExceptionHandler
      extended by org.springframework.richclient.exceptionhandling.AbstractLoggingExceptionHandler
All Implemented Interfaces:
Thread.UncaughtExceptionHandler, RegisterableExceptionHandler
Direct Known Subclasses:
AbstractDialogExceptionHandler, SilentExceptionHandler

public abstract class AbstractLoggingExceptionHandler
extends AbstractRegisterableExceptionHandler

Superclass of logging exception handlers. It handles a throwable by logging it and notify it to the user. Subclasses determine how it's notified to the user.

Since:
0.3
Author:
Geoffrey De Smet

Field Summary
protected  ExceptionPurger exceptionPurger
           
protected static String LOG_MESSAGE
           
protected  org.apache.commons.logging.Log logger
           
protected  LogLevel logLevel
           
 
Constructor Summary
AbstractLoggingExceptionHandler()
           
 
Method Summary
 void logException(Thread thread, Throwable throwable)
          Log an exception
abstract  void notifyUserAboutException(Thread thread, Throwable throwable)
          Notify user about an exception
 void setExceptionPurger(ExceptionPurger exceptionPurger)
          If set the throwable will first be purged before handling it.
 void setLogLevel(LogLevel logLevel)
          The log level at which the throwable should be logged.
 void uncaughtException(Thread thread, Throwable throwable)
          Logs an exception and shows it to the user.
 
Methods inherited from class org.springframework.richclient.exceptionhandling.AbstractRegisterableExceptionHandler
registerExceptionHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_MESSAGE

protected static final String LOG_MESSAGE
See Also:
Constant Field Values

logger

protected final transient org.apache.commons.logging.Log logger

logLevel

protected LogLevel logLevel

exceptionPurger

protected ExceptionPurger exceptionPurger
Constructor Detail

AbstractLoggingExceptionHandler

public AbstractLoggingExceptionHandler()
Method Detail

setLogLevel

public void setLogLevel(LogLevel logLevel)
The log level at which the throwable should be logged. The default is ERROR.

Parameters:
logLevel - the

setExceptionPurger

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

Parameters:
exceptionPurger -

uncaughtException

public final void uncaughtException(Thread thread,
                                    Throwable throwable)
Logs an exception and shows it to the user.


logException

public void logException(Thread thread,
                         Throwable throwable)
Log an exception


notifyUserAboutException

public abstract void notifyUserAboutException(Thread thread,
                                              Throwable throwable)
Notify user about an exception



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