Class ExceptionConvertingCallable<V,E extends Exception>
java.lang.Object
de.aristaflow.adept2.util.threading.ExceptionConvertingCallable<V,E>
- Type Parameters:
V- The type of result of the method to call.E- The type of the throwable to replace an occurred exception.
- All Implemented Interfaces:
Callable<V>
public class ExceptionConvertingCallable<V,E extends Exception>
extends Object
implements Callable<V>
This class provides the means to call a method and replace an occurred exception by a different
one. This is useful if the occurred exception is transferred to a remote JVM that does not know
the occurred exception or that should not need to know the exception.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExceptionConvertingCallable(ThrowableCreatingCallable<V, E> tcc, Logger logger) Creates a new callable executing a method and logging and replacing an occurred exception by a different one. -
Method Summary
-
Field Details
-
tcc
The callable providing the actual call as well as the means to replace an occurred exception. -
logger
The logger for logging the occurred exception.
-
-
Constructor Details
-
ExceptionConvertingCallable
Creates a new callable executing a method and logging and replacing an occurred exception by a different one.- Parameters:
tcc- The callable providing the actual call as well as the means to replace an occurred exception.logger- The logger for logging the occurred exception.
-
-
Method Details