Interface ExceptionHandler

All Known Implementing Classes:
EmptyExceptionHandler, SyslogExceptionHandler

public interface ExceptionHandler

Generic interface for Exception Handler.

This interface is provided to manage exception.

$Revision: 1.9 $

Nested Class Summary
static class ExceptionHandler.RejectExceptionHandling
          Convenient class used to mean that an exception raised has not been handled by an ExceptionHandler instance.
static class ExceptionHandler.UnHandledException
          Generic class allowing any exception to be thrown and wrapped in a new RuntimeException one.
Method Summary
 java.lang.Object handleException(java.lang.Object exceptionInfo)
          This method is called when an exception occurs.

Method Detail


public java.lang.Object handleException(java.lang.Object exceptionInfo)

This method is called when an exception occurs.

Implementation can print a verbose output, send a mail to an administrator...

The returned object (called newState in the following) provides information on what to do after an exception had been handled by its ExceptionHandler.
If newState != RejectExceptionHandling.REJECT the current thread is allowed to continue its execution has if no exception had been thrown. For this purpose, the thread may use the newState returned object to recover a valid state. Else, the current thread is allowed to re-throw the exception.

exceptionInfo - an object representing informations on the occured exception. It might be, the throwable itself, but can also be a Method object providing enough information to ensure state recovering.
a newState object wich informs the thread whom had called this method (which is probably the one which has caught the exception) the following instruction to execute.

Mandala help mailing list