-
- Type Parameters:
RESPONSE
- response type. It can be either a general-purposeResponse
or 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 and Description void
completed(RESPONSE response)
Called when the invocation was successfully completed.void
failed(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
Response
instance 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
Throwable
may be aProcessingException
in case the invocation processing failure has been caused by a client-side runtime component error. TheThrowable
may also be aWebApplicationException
or one of its subclasses in case the response status code is notsuccessful
and the generic callback type is notResponse
. In case a processing of a properly received response fails, the wrapped processing exception will be ofResponseProcessingException
type and will contain theResponse
instance whose processing has failed. ACancellationException
would be indicate that the invocation has been cancelled. AnInterruptedException
would indicate that the thread executing the invocation has been interrupted.Once this invocation callback method returns, the underlying
Response
instance will be automatically closed by the runtime.- Parameters:
throwable
- contains failure details.
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/ws/rs/client/InvocationCallback.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.