public class LoggingUncaughtExceptionHandler extends Object implements Thread.UncaughtExceptionHandler
Thread.UncaughtExceptionHandler
that writes the exception to the application log via
the SLF4J framework. Once registered with Thread.setUncaughtExceptionHandler(UncaughtExceptionHandler)
it will be invoked by the JVM when a thread has been abruptly terminated due to an uncaught exception.
Owing to the contract of Runnable.run()
, the only possible exception types which can cause such a termination
are instances of RuntimeException
and Error
. These exceptions are catastrophic and the client must
restart the JVM.
The implementation also invokes ThreadGroup.uncaughtException(Thread, Throwable)
. This
is done to retain compatibility with any monitoring solutions (for example, log scraping of
standard error) that existing users of older Qpid client libraries may have in place.
Constructor and Description |
---|
LoggingUncaughtExceptionHandler() |
public void uncaughtException(Thread t, Throwable e)
uncaughtException
in interface Thread.UncaughtExceptionHandler
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.