javax.ws.rs.container
Interface ResumeCallback


public interface ResumeCallback

Asynchronous request processing lifecycle callback that receives suspended asynchronous response resume events.

A resume callback may receive resume events (from an asynchronous response the callback was registered with) as a result of one of the following actions:

In all of the cases above, a resume event will be generated for the suspended asynchronous response and all callbacks associated with the asynchronous response that implement ResumeCallback interface will be invoked before any response processing is started, e.g. before any exception mapping or response filtering occurs.

Since:
2.0
Author:
Marek Potociar

Method Summary
 void onResume(AsyncResponse resuming, Response response)
          A resume callback notification method that will be invoked when the asynchronous response is about to be resumed with a JAX-RS response instance.
 void onResume(AsyncResponse resuming, java.lang.Throwable error)
          A resume callback notification method that will be invoked in case the asynchronous response is being resumed by an error (e.g.
 

Method Detail

onResume

void onResume(AsyncResponse resuming,
              Response response)
A resume callback notification method that will be invoked when the asynchronous response is about to be resumed with a JAX-RS response instance. This means the method is invoked BEFORE any response processing (e.g. response filters execution) starts.

Callback implementations may use check whether resuming asynchronous response has been cancelled or not. In case of cancellation, the JAX-RS response will be the request cancellation response sent back to the client (see AsyncResponse.cancel()).

Parameters:
resuming - asynchronous response to be resumed.
response - response used to resume the asynchronous response.

onResume

void onResume(AsyncResponse resuming,
              java.lang.Throwable error)
A resume callback notification method that will be invoked in case the asynchronous response is being resumed by an error (e.g. in case of a time-out event). This means the method is invoked BEFORE any response processing (e.g. exception mapping or response filters execution) starts.

Parameters:
resuming - asynchronous response to be resumed.
error - error used to resume the asynchronous response.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.