org.glassfish.jersey.servlet.spi
Interface AsyncContextDelegate


public interface AsyncContextDelegate

Utilized by the Servlet container response writer to deal with the container async features. Individual instances are created by AsyncContextDelegateProvider.

Author:
Jakub Podlesak (jakub.podlesak at oracle.com)
See Also:
AsyncContextDelegateProvider

Method Summary
 void complete()
          Invoked upon a response writing completion when the response write is either committed or canceled.
 void setSuspendTimeout(long timeOut, java.util.concurrent.TimeUnit timeUnit)
          Invoked by the superior ContainerResponseWriter responsible for writing the response when new timeout values are to be set.
 void suspend(ContainerResponseWriter writer, long timeOut, java.util.concurrent.TimeUnit timeUnit, ContainerResponseWriter.TimeoutHandler timeoutHandler)
          Invoked by the superior ContainerResponseWriter responsible for writing the response when processing is to be suspended.
 

Method Detail

suspend

void suspend(ContainerResponseWriter writer,
             long timeOut,
             java.util.concurrent.TimeUnit timeUnit,
             ContainerResponseWriter.TimeoutHandler timeoutHandler)
             throws java.lang.IllegalStateException
Invoked by the superior ContainerResponseWriter responsible for writing the response when processing is to be suspended. An implementation can throw an UnsupportedOperationException if suspend is not supported (the default behavior).

Parameters:
writer - response writer.
timeOut - time-out value.
timeUnit - time-out time unit.
timeoutHandler - response writer time-out handler.
Throws:
java.lang.IllegalStateException
See Also:
ContainerResponseWriter.suspend(long, java.util.concurrent.TimeUnit, org.glassfish.jersey.server.spi.ContainerResponseWriter.TimeoutHandler)

setSuspendTimeout

void setSuspendTimeout(long timeOut,
                       java.util.concurrent.TimeUnit timeUnit)
                       throws java.lang.IllegalStateException
Invoked by the superior ContainerResponseWriter responsible for writing the response when new timeout values are to be set. An implementation can throw an UnsupportedOperationException if suspend is not supported (the default behavior).

Parameters:
timeOut - new time-out value.
timeUnit - new time-out time unit.
Throws:
java.lang.IllegalStateException
See Also:
ContainerResponseWriter.setSuspendTimeout(long, java.util.concurrent.TimeUnit)

complete

void complete()
Invoked upon a response writing completion when the response write is either committed or canceled.



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