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