org.apache.mina.common

Class ExceptionMonitor

Known Direct Subclasses:
DefaultExceptionMonitor

public abstract class ExceptionMonitor
extends java.lang.Object

Monitors uncaught exceptions. exceptionCaught(Throwable) is invoked when there are any uncaught exceptions.

You can monitor any uncaught exceptions by setting ExceptionMonitor by calling setInstance(ExceptionMonitor). The default monitor logs all caught exceptions in WARN level using SLF4J.

See Also:
DefaultExceptionMonitor

Method Summary

abstract void
exceptionCaught(Throwable cause)
Invoked when there are any uncaught exceptions.
static ExceptionMonitor
getInstance()
Returns the current exception monitor.
static void
setInstance(ExceptionMonitor monitor)
Sets the uncaught exception monitor.

Method Details

exceptionCaught

public abstract void exceptionCaught(Throwable cause)
Invoked when there are any uncaught exceptions.

getInstance

public static ExceptionMonitor getInstance()
Returns the current exception monitor.

setInstance

public static void setInstance(ExceptionMonitor monitor)
Sets the uncaught exception monitor. If null is specified, the default monitor will be set.
Parameters:
monitor - A new instance of DefaultExceptionMonitor is set if null is specified.