Class ExceptionLoggingRunnable
java.lang.Object
de.aristaflow.adept2.util.threading.ExceptionLoggingRunnable
- All Implemented Interfaces:
Runnable
A runnable catching runtime exceptions and virtual machine errors and optionally rethrowing them.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExceptionLoggingRunnable(Runnable runnable, boolean rethrow, Logger logger) Wraps the designated runnable to catch and log runtime exceptions and virtual machine errors to the designated logger and optionally rethrowing the runtime exception/virtual machine error. -
Method Summary
-
Field Details
-
runnable
The wrapped runnable. -
rethrow
protected final boolean rethrowWhether to rethrow an occurred runtime exception or virtual machine error. In case of a scheduled runnable, rethrowing will stop further executions. -
logger
The logger with which to log an exception.
-
-
Constructor Details
-
ExceptionLoggingRunnable
Wraps the designated runnable to catch and log runtime exceptions and virtual machine errors to the designated logger and optionally rethrowing the runtime exception/virtual machine error. In case of a scheduled runnable, rethrowing will stop further executions.- Parameters:
runnable- The wrapped runnable.rethrow- Whether to rethrow an occurred runtime exception or virtual machine error.logger- The logger with which to log an exception.
-
-
Method Details