站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

ThrowableHandler (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util
Class ThrowableHandler

java.lang.Object
  extended byorg.jboss.util.ThrowableHandler

public final class ThrowableHandler
extends Object

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

Version:
$Revision: 1.3 $
Author:
Jason Dillon

Nested Class Summary
static interface ThrowableHandler.Type
          Container for throwable types.
 
Field Summary
protected static List listeners
          The list of listeners
 
Constructor Summary
ThrowableHandler()
           
 
Method Summary
static void add(int type, Throwable t)
          Add a throwable that is to be handled.
static void add(Throwable t)
          Add a throwable that is to be handled with unknown type.
static void addError(Throwable t)
          Add a throwable that is to be handled with error type.
static void addThrowableListener(ThrowableListener listener)
          Add a ThrowableListener to the listener list.
static void addWarning(Throwable t)
          Add a throwable that is to be handled with warning type.
protected static void fireOnThrowable(int type, Throwable t)
          Fire onThrowable to all registered listeners.
static void removeThrowableListener(ThrowableListener listener)
          Remove a ThrowableListener from the listener list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected static List listeners
The list of listeners

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.

fireOnThrowable

protected static void fireOnThrowable(int type,
                                      Throwable t)
Fire onThrowable to all registered listeners.

Parameters:
type - The type off the throwable.
t - Throwable

add

public static void add(int type,
                       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(Throwable t)
Add a throwable that is to be handled with unknown type.

Parameters:
t - Throwable to be handled.

addError

public static void addError(Throwable t)
Add a throwable that is to be handled with error type.

Parameters:
t - Throwable to be handled.

addWarning

public static void addWarning(Throwable t)
Add a throwable that is to be handled with warning type.

Parameters:
t - Throwable to be handled.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.