public interface ActionListener<Response>
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(Response response)
Handle action response.
|
static <Response> ActionListener<Response> |
wrap(java.util.function.Consumer<Response> onResponse,
java.util.function.Consumer<java.lang.Exception> onFailure)
Creates a listener that listens for a response (or failure) and executes the
corresponding consumer when the response (or failure) is received.
|
void onResponse(Response response)
void onFailure(java.lang.Exception e)
static <Response> ActionListener<Response> wrap(java.util.function.Consumer<Response> onResponse, java.util.function.Consumer<java.lang.Exception> onFailure)
Response
- the type of the responseonResponse
- the consumer of the response, when the listener receives oneonFailure
- the consumer of the failure, when the listener receives one