Interface InvocationCallback<RESPONSE>
-
- Type Parameters:
RESPONSE- response type. It can be either a general-purposeResponseor the anticipated response entity type.
public interface InvocationCallback<RESPONSE>Callback that can be implemented to receive the asynchronous processing events from the invocation processing.- Since:
- 2.0
- Author:
- Marek Potociar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcompleted(RESPONSE response)Called when the invocation was successfully completed.voidfailed(Throwable throwable)Called when the invocation has failed for any reason.
-
-
-
Method Detail
-
completed
void completed(RESPONSE response)
Called when the invocation was successfully completed. Note that this does not necessarily mean the response has bean fully read, which depends on the parameterized invocation callback response type.Once this invocation callback method returns, the underlying
Responseinstance will be automatically closed by the runtime.- Parameters:
response- response data.
-
failed
void failed(Throwable throwable)
Called when the invocation has failed for any reason.Note that the provided
Throwablemay be aProcessingExceptionin case the invocation processing failure has been caused by a client-side runtime component error. TheThrowablemay also be aWebApplicationExceptionor one of its subclasses in case the response status code is notsuccessfuland the generic callback type is notResponse. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingExceptiontype and will contain theResponseinstance whose processing has failed. ACancellationExceptionwould be indicate that the invocation has been cancelled. AnInterruptedExceptionwould indicate that the thread executing the invocation has been interrupted.Once this invocation callback method returns, the underlying
Responseinstance will be automatically closed by the runtime.- Parameters:
throwable- contains failure details.
-
-