Package org.jboss.util
Class ThrowableHandler
- java.lang.Object
-
- org.jboss.util.ThrowableHandler
-
public final class ThrowableHandler extends java.lang.ObjectA static singleton that handles processing throwables that otherwise would be ignored or dumped to System.err.- Version:
- $Revision$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceThrowableHandler.TypeContainer for throwable types.
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.List<ThrowableListener>listenersThe list of listeners
-
Constructor Summary
Constructors Constructor Description ThrowableHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidadd(int type, java.lang.Throwable t)Add a throwable that is to be handled.static voidadd(java.lang.Throwable t)Add a throwable that is to be handled with unknown type.static voidaddError(java.lang.Throwable t)Add a throwable that is to be handled with error type.static voidaddThrowableListener(ThrowableListener listener)Add a ThrowableListener to the listener list.static voidaddWarning(java.lang.Throwable t)Add a throwable that is to be handled with warning type.protected static voidfireOnThrowable(int type, java.lang.Throwable t)Fire onThrowable to all registered listeners.static voidremoveThrowableListener(ThrowableListener listener)Remove a ThrowableListener from the listener list.
-
-
-
Field Detail
-
listeners
protected static java.util.List<ThrowableListener> listeners
The list of listeners
-
-
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.
-
fireOnThrowable
protected static void fireOnThrowable(int type, java.lang.Throwable t)Fire onThrowable to all registered listeners.- Parameters:
type- The type off the throwable.t- Throwable
-
add
public static void add(int type, java.lang.Throwable t)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.
-
addError
public static void addError(java.lang.Throwable t)
Add a throwable that is to be handled with error type.- Parameters:
t- Throwable to be handled.
-
addWarning
public static void addWarning(java.lang.Throwable t)
Add a throwable that is to be handled with warning type.- Parameters:
t- Throwable to be handled.
-
-