org.huihoo.jfox.ejb.exception
Class ThrowableHandler

java.lang.Object
  |
  +--org.huihoo.jfox.ejb.exception.ThrowableHandler

public final class ThrowableHandler
extends java.lang.Object

A static singleton that handles processing throwables that otherwise would be ignored or dumped to System.err.

Version:
Revision: 0.9.0
Author:
tai_1219@sina.com

Nested Class Summary
static interface ThrowableHandler.Type
          Container for throwable types.
 
Constructor Summary
ThrowableHandler()
           
 
Method Summary
static void add(int type, java.lang.Throwable t)
          /////////////////////////////////////////////////////////////////////// Throwable Processing // /////////////////////////////////////////////////////////////////////// Add a throwable that is to be handled.
static void add(java.lang.Throwable t)
          Add a throwable that is to be handled with unknown type.
static void addThrowableListener(ThrowableListener listener)
          Add a ThrowableListener to the listener list.
static void removeThrowableListener(ThrowableListener listener)
          Remove a ThrowableListener from the listener list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThrowableHandler

public ThrowableHandler()
Method Detail

addThrowableListener

public static void addThrowableListener(ThrowableListener listener)
Add a ThrowableListener to the listener list. Listener is added only if if it is not already in the list.

Parameters:
listener - ThrowableListener to add to the list.

removeThrowableListener

public static void removeThrowableListener(ThrowableListener listener)
Remove a ThrowableListener from the listener list.

Parameters:
listener - ThrowableListener to remove from the list.

add

public static void add(int type,
                       java.lang.Throwable t)
/////////////////////////////////////////////////////////////////////// Throwable Processing // /////////////////////////////////////////////////////////////////////// Add a throwable that is to be handled.

Parameters:
type - The type off the throwable.
t - Throwable to be handled.

add

public static void add(java.lang.Throwable t)
Add a throwable that is to be handled with unknown type.

Parameters:
t - Throwable to be handled.