Package org.apache.mina.util
Class ExceptionMonitor
- java.lang.Object
-
- org.apache.mina.util.ExceptionMonitor
-
- Direct Known Subclasses:
DefaultExceptionMonitor
public abstract class ExceptionMonitor extends java.lang.ObjectMonitors uncaught exceptions.exceptionCaught(Throwable)is invoked when there are any uncaught exceptions.You can monitor any uncaught exceptions by setting
ExceptionMonitorby callingsetInstance(ExceptionMonitor). The default monitor logs all caught exceptions inWARNlevel using SLF4J.- See Also:
DefaultExceptionMonitor
-
-
Field Summary
Fields Modifier and Type Field Description private static ExceptionMonitorinstance
-
Constructor Summary
Constructors Constructor Description ExceptionMonitor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidexceptionCaught(java.lang.Throwable cause)Invoked when there are any uncaught exceptions.static ExceptionMonitorgetInstance()static voidsetInstance(ExceptionMonitor monitor)Sets the uncaught exception monitor.
-
-
-
Field Detail
-
instance
private static ExceptionMonitor instance
-
-
Method Detail
-
getInstance
public static ExceptionMonitor getInstance()
- Returns:
- the current exception monitor.
-
setInstance
public static void setInstance(ExceptionMonitor monitor)
Sets the uncaught exception monitor. Ifnullis specified, the default monitor will be set.- Parameters:
monitor- A new instance ofDefaultExceptionMonitoris set ifnullis specified.
-
exceptionCaught
public abstract void exceptionCaught(java.lang.Throwable cause)
Invoked when there are any uncaught exceptions.- Parameters:
cause- The caught exception
-
-