public abstract class LoggingUncaughtThreadDeathContextRunnable extends Object implements Runnable
run() method that catches any unexpected checked
exceptions (RuntimeException & Error) and logs them with
some kind of context which allows to better identify the root cause.| Modifier | Constructor and Description |
|---|---|
protected |
LoggingUncaughtThreadDeathContextRunnable(org.slf4j.Logger logger,
Supplier<String> debugLogContextSupplier)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
run()
Final run() method; subclasses implement
runWithUncheckedExceptionLogging() instead of this. |
protected abstract void |
runWithUncheckedExceptionLogging()
Run method which you implement instead of the original
run(). |
static Runnable |
wrap(Runnable runnable,
org.slf4j.Logger logger,
Supplier<String> debugLogContextSupplier)
Wraps an existing Runnable.
|
protected LoggingUncaughtThreadDeathContextRunnable(org.slf4j.Logger logger,
Supplier<String> debugLogContextSupplier)
logger - the Logger of the class which created this RunnabledebugLogContextSupplier - supplies useful context included in error log in case of caught checked exceptionpublic static Runnable wrap(Runnable runnable, org.slf4j.Logger logger, Supplier<String> debugLogContextSupplier)
logger - the Logger of the class which created this RunnabledebugLogContextSupplier - supplies useful context included in error log in case of caught checked exceptionpublic final void run()
runWithUncheckedExceptionLogging() instead of this.protected abstract void runWithUncheckedExceptionLogging()
run().Copyright © 2019 OpenDaylight. All rights reserved.