|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.kosi.util.ExceptionHandler
The ExceptionHandlers implements a ''Chain of Responibility'' pattern for
Exceptions. When the handleException()
of a ExceptionHandler is
called, it should either handle the Exception by itself, or invoke its
parent handler. The last handler in the chain is a PrintExceptionHandler,
that does nothing but print the Exception to System.err.
To handle an Exception using the default exceptionhandler
ExceptionHandler.handle()
is called. This should be the default
way of handling an exception, if no concrete handler is available.
ChangeLog:
$Log: ExceptionHandler.java,v $ Revision 1.2 2001/06/04 14:21:10 jiriki Made source more comliant to coding guidelines. Revision 1.1.1.1 2001/04/29 18:05:20 jiriki Imported sources from zola. Revision 1.1 2001/04/29 16:50:44 wombat Added ExceptionHandlers
Constructor Summary | |
ExceptionHandler()
Create a new ExceptionHandler with the default exception handler as parent. |
|
ExceptionHandler(ExceptionHandler parent)
Create a new ExceptionHandler with the given parent. |
Method Summary | |
static void |
addDefaultExceptionHandler(ExceptionHandler handler)
Add an ExceptionHandler to the ''Chain of Responsibility'' of ExceptionHandler. |
protected ExceptionHandler |
getParent()
Get the parent handler of this handler. |
static void |
handle(java.lang.Throwable e)
Handle an Exception. |
abstract void |
handleException(java.lang.Throwable e)
Handle an Throwable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExceptionHandler()
public ExceptionHandler(ExceptionHandler parent)
parent
- Parent handler.Method Detail |
public abstract void handleException(java.lang.Throwable e)
e
- Throwable to be handled.protected ExceptionHandler getParent()
public static void handle(java.lang.Throwable e)
handleException()
of
the default exception handler.e
- The Exception to be handled.public static void addDefaultExceptionHandler(ExceptionHandler handler)
handler
- The ExceptionHandler to be added.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |