ActionListener<R>public final class ContextPreservingActionListener<R> extends java.lang.Object implements ActionListener<R>
ThreadContext.StoredContext
once the listener is invoked| Constructor | Description |
|---|---|
ContextPreservingActionListener(java.util.function.Supplier<ThreadContext.StoredContext> contextSupplier,
ActionListener<R> delegate) |
| Modifier and Type | Method | 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 |
public 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