public interface CallbackWrapper
FutureCallback
such
that additional logic can be introduced to the callback.
This class also contains the predefined wrappers exceptionDropper
and identity
.
Modifier and Type | Field and Description |
---|---|
static CallbackWrapper |
exceptionDropper
A callback wrapper that catches and logs exceptions thrown within the
wrapped callback at the ERROR level.
|
static CallbackWrapper |
identity
The identity callback wrapper.
|
Modifier and Type | Method and Description |
---|---|
<T> FutureCallback<T> |
wrap(FutureCallback<T> callback)
Wraps the given callback.
|
static final CallbackWrapper exceptionDropper
static final CallbackWrapper identity
@Nullable <T> FutureCallback<T> wrap(@Nullable FutureCallback<T> callback)
null
from this method, in which case no callback will be called.T
- the result type of the callbackcallback
- the callback object to wrapCopyright © 2016–2019 CLX Communications. All rights reserved.