V - the result type of method callpublic class ExceptionLoggingCallable<V>
extends java.lang.Object
implements java.util.concurrent.Callable<V>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.Callable<V> |
callable
The wrapped callable.
|
protected java.util.logging.Logger |
logger
The logger with which to log an exception.
|
protected boolean |
rethrow
Whether to rethrow an occurred exception or virtual machine error.
|
| Constructor and Description |
|---|
ExceptionLoggingCallable(java.util.concurrent.Callable<V> callable,
boolean rethrow,
java.util.logging.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.
|
| Modifier and Type | Method and Description |
|---|---|
V |
call() |
protected final java.util.concurrent.Callable<V> callable
protected final boolean rethrow
protected final java.util.logging.Logger logger
public ExceptionLoggingCallable(java.util.concurrent.Callable<V> callable, boolean rethrow, java.util.logging.Logger logger)
callable - The wrapped callable.rethrow - Whether to rethrow an occurred exception or virtual machine error.logger - The logger with which to log an exception.