org.xnap.commons.util
Class UncaughtExceptionManager

java.lang.Object
  extended by org.xnap.commons.util.UncaughtExceptionManager
All Implemented Interfaces:
EventListener, UncaughtExceptionListener

public class UncaughtExceptionManager
extends Object
implements UncaughtExceptionListener

Author:
Tammo van Lessen, Steffen Pingel

Field Summary
static String[] DEFAULT_MANGLE_PREFIXES
           
 
Constructor Summary
UncaughtExceptionManager()
           
UncaughtExceptionManager(File blacklistFile)
           
UncaughtExceptionManager(File blacklistFile, String[] manglePrefixes)
           
 
Method Summary
 void addExceptionListener(UncaughtExceptionListener l)
           
 void addToBlacklist(Throwable e)
           
static UncaughtExceptionListener getDefaultHandler()
           
static String removeExceptionDescription(String trace, String prefix)
           
 void removeExceptionListener(UncaughtExceptionListener l)
           
 void sendProblemReport(URL destination, Thread thread, Throwable throwable, String version, String plugin)
           
static void setDefaultHandler(UncaughtExceptionListener handler)
           
 String toString(Throwable e)
          Returns the stacktrace of e as a String.
 void uncaughtException(Thread t, Throwable e)
          Handles e thrown by t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MANGLE_PREFIXES

public static String[] DEFAULT_MANGLE_PREFIXES
Constructor Detail

UncaughtExceptionManager

public UncaughtExceptionManager(File blacklistFile,
                                String[] manglePrefixes)

UncaughtExceptionManager

public UncaughtExceptionManager(File blacklistFile)

UncaughtExceptionManager

public UncaughtExceptionManager()
Method Detail

removeExceptionDescription

public static String removeExceptionDescription(String trace,
                                                String prefix)

getDefaultHandler

public static UncaughtExceptionListener getDefaultHandler()

setDefaultHandler

public static void setDefaultHandler(UncaughtExceptionListener handler)

addExceptionListener

public void addExceptionListener(UncaughtExceptionListener l)

addToBlacklist

public void addToBlacklist(Throwable e)

removeExceptionListener

public void removeExceptionListener(UncaughtExceptionListener l)

sendProblemReport

public void sendProblemReport(URL destination,
                              Thread thread,
                              Throwable throwable,
                              String version,
                              String plugin)
                       throws IOException
Parameters:
destination -
thread -
throwable -
version -
plugin -
Throws:
IOException

toString

public String toString(Throwable e)
Returns the stacktrace of e as a String.

Parameters:
e - the exception

uncaughtException

public void uncaughtException(Thread t,
                              Throwable e)
Handles e thrown by t. Notifies all listeners in case e is not blacklisted.

Specified by:
uncaughtException in interface UncaughtExceptionListener


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.