public final class ContextPreservingActionListener<R> extends java.lang.Object implements ActionListener<R>
ThreadContext.StoredContext
once the listener is invoked| Constructor and Description |
|---|
ContextPreservingActionListener(java.util.function.Supplier<ThreadContext.StoredContext> contextSupplier,
ActionListener<R> delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(java.lang.Exception e)
A failure caused by an exception at some phase of the task.
|
void |
onResponse(R r)
Handle action response.
|
static <R> ContextPreservingActionListener<R> |
wrapPreservingContext(ActionListener<R> listener,
ThreadContext threadContext)
Wraps the provided action listener in a
ContextPreservingActionListener that will
also copy the response headers when the ThreadContext.StoredContext is closed |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonFailure, onResponse, wrappublic ContextPreservingActionListener(java.util.function.Supplier<ThreadContext.StoredContext> contextSupplier, ActionListener<R> delegate)
public void onResponse(R r)
ActionListeneronResponse in interface ActionListener<R>public void onFailure(java.lang.Exception e)
ActionListeneronFailure in interface ActionListener<R>public static <R> ContextPreservingActionListener<R> wrapPreservingContext(ActionListener<R> listener, ThreadContext threadContext)
ContextPreservingActionListener that will
also copy the response headers when the ThreadContext.StoredContext is closed