javax.ws.rs.client
Interface InvocationCallback<RESPONSE>

Type Parameters:
RESPONSE - response type. It can be either a general-purpose Response 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
 void completed(RESPONSE response)
          Called when the invocation was successfully completed.
 void failed(ClientException error)
          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. This depends on the expected invocation callback response type.

Parameters:
response - response data.

failed

void failed(ClientException error)
Called when the invocation has failed for any reason.

Note that the provided ClientException may contain a cause represented by nested WebApplicationException or one of its subclasses in case the response status code is not successful and the generic callback type is not Response.

Parameters:
error - contains failure details.


Copyright © 2013. All Rights Reserved.