ch.elca.el4j.services.gui.swing.exceptions
Class Exceptions

java.lang.Object
  extended by ch.elca.el4j.services.gui.swing.exceptions.Exceptions
All Implemented Interfaces:
Thread.UncaughtExceptionHandler

public final class Exceptions
extends Object
implements Thread.UncaughtExceptionHandler

This Exception Handler Manager allows to register Exception Handlers. If an uncaught exception occurs, the handlers get executed in the order of their priority until a handler signals that no further handler should be called (handle() return true). In case that no handlers get executed, a stack trace will be printed to std err.

Author:
Stefan Wismer (SWI)
File-location:
Exceptions
Last check-in date:
2009-10-22 16:29:06 +0200 (Do, 22. Okt 2009) by swismer for revision 3979

Constructor Summary
Exceptions()
           
 
Method Summary
 void addHandler(Handler handler)
          Add an exception handler.
static Exceptions getInstance()
           
 void handle(Exception e)
          Execute all Handlers that recognize the given Exception (in the order of their priority) until a handler signals to stop.
 void handle(Throwable t)
          Handler for AWT exceptions.
 void removeHandler(Handler handler)
          Remove an exception handler.
 void uncaughtException(Thread t, Throwable e)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exceptions

public Exceptions()
Method Detail

getInstance

public static Exceptions getInstance()
Returns:
the singleton instance

addHandler

public void addHandler(Handler handler)
Add an exception handler.

Parameters:
handler - the handler to add

removeHandler

public void removeHandler(Handler handler)
Remove an exception handler.

Parameters:
handler - the handler to add

handle

public void handle(Exception e)
Execute all Handlers that recognize the given Exception (in the order of their priority) until a handler signals to stop. In case that no handlers get executed, a stack trace will be printed to std err.

Parameters:
e - the exception to handle

handle

public void handle(Throwable t)
Handler for AWT exceptions.

Parameters:
t - a Throwable

uncaughtException

public void uncaughtException(Thread t,
                              Throwable e)

Specified by:
uncaughtException in interface Thread.UncaughtExceptionHandler


Copyright © 2005-2011 ELCA. All Rights Reserved.