org.glassfish.jersey.process.internal
Interface InvocationCallback


public interface InvocationCallback

Request transformation callback used by a request invoker to provide asynchronous notifications about the request processing.

The callback is invoked when the request transformation is suspended or completed either successfully or by a failure.

Author:
Marek Potociar (marek.potociar at oracle.com)

Method Summary
 void cancelled()
          Request processing cancel event notification.
 void failure(java.lang.Throwable exception)
          A request-to-response transformation failure event notification.
 void result(Response response)
          A successful request-to-response transformation event notification.
 void resumed()
          Request processing resume event notification.
 void suspended(long time, java.util.concurrent.TimeUnit unit, InvocationContext context)
          Request processing suspend event notification.
 void suspendTimeoutChanged(long time, java.util.concurrent.TimeUnit unit)
          Request processing suspend timeout change event notification.
 

Method Detail

suspended

void suspended(long time,
               java.util.concurrent.TimeUnit unit,
               InvocationContext context)
Request processing suspend event notification. Request invoker invokes the suspended(...) callback method when it receives an instruction to suspend the current request processing via one of the invocation context suspend(...) methods.

Parameters:
time - suspend time-out value.
unit - suspend time-out time unit.
context - suspended invocation context.

suspendTimeoutChanged

void suspendTimeoutChanged(long time,
                           java.util.concurrent.TimeUnit unit)
Request processing suspend timeout change event notification. Request invoker invokes the suspendTimeoutChanged(...) callback method when it receives an instruction to update the timeout value for the current (suspended) request.

Parameters:
time - new suspend time-out value.
unit - new suspend time-out time unit.

resumed

void resumed()
Request processing resume event notification. Request invoker invokes the resumed() callback method when it receives an instruction to resume the current suspended request processing via one of the invocation context resume(...) methods.

Note that the resumed() callback method will not be invoked in case the invocation context has not been in a suspended state when the resume(...) method was invoked.


cancelled

void cancelled()
Request processing cancel event notification. Request invoker invokes the cancelled() callback method when it receives an instruction to cancel the current request processing via invocation context cancel() method.


result

void result(Response response)
A successful request-to-response transformation event notification.

Parameters:
response - transformation result.

failure

void failure(java.lang.Throwable exception)
A request-to-response transformation failure event notification.

Parameters:
exception - exception describing the failure.


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