Top Description Methods
jakarta.ws.rs.client

public Interface InvocationCallback<RESPONSE>

Type Parameters
<RESPONSE>
response type. It can be either a general-purpose jakarta.ws.rs.core.Response or the anticipated response entity type.

Callback that can be implemented to receive the asynchronous processing events from the invocation processing.
Author
Marek Potociar
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public void
completed(RESPONSE
response data.
response
)

Called when the invocation was successfully completed.

public void
failed(Throwable
contains failure details.
throwable
)

Called when the invocation has failed for any reason.

Method Detail

completedback to summary
public 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 jakarta.ws.rs.core.Response instance will be automatically closed by the runtime.

Parameters
response:RESPONSE

response data.

failedback to summary
public void failed(Throwable throwable)

Called when the invocation has failed for any reason.

Note that the provided Throwable may be a jakarta.ws.rs.ProcessingException in case the invocation processing failure has been caused by a client-side runtime component error. The Throwable may also be a jakarta.ws.rs.WebApplicationException or one of its subclasses in case the response status code is not successful and the generic callback type is not jakarta.ws.rs.core.Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the jakarta.ws.rs.core.Response instance whose processing has failed. A java.util.concurrent.CancellationException would be indicate that the invocation has been cancelled. An InterruptedException would indicate that the thread executing the invocation has been interrupted.

Once this invocation callback method returns, the underlying jakarta.ws.rs.core.Response instance will be automatically closed by the runtime.

Parameters
throwable:Throwable

contains failure details.