Class ServerRuntime.AsyncResponder

java.lang.Object
org.glassfish.jersey.server.ServerRuntime.AsyncResponder
All Implemented Interfaces:
javax.ws.rs.container.AsyncResponse, javax.ws.rs.container.CompletionCallback, AsyncContext, ContainerResponseWriter.TimeoutHandler
Enclosing class:
ServerRuntime

private static class ServerRuntime.AsyncResponder extends Object implements AsyncContext, ContainerResponseWriter.TimeoutHandler, javax.ws.rs.container.CompletionCallback
  • Field Details

  • Constructor Details

  • Method Details

    • onTimeout

      public void onTimeout(ContainerResponseWriter responseWriter)
      Description copied from interface: ContainerResponseWriter.TimeoutHandler
      Method is called, when ContainerResponseWriter.suspend(...) operation times out. The custom time-out handler implementation is responsible for making sure a (time-out) response is written to the context and that the container context is properly closed.
      Specified by:
      onTimeout in interface ContainerResponseWriter.TimeoutHandler
      Parameters:
      responseWriter - suspended container response writer that timed out.
    • onComplete

      public void onComplete(Throwable throwable)
      Specified by:
      onComplete in interface javax.ws.rs.container.CompletionCallback
    • invokeManaged

      public void invokeManaged(Producer<javax.ws.rs.core.Response> producer)
      Description copied from interface: AsyncContext
      Invoke the provided response producer in a Jersey-managed asynchronous thread.
      Specified by:
      invokeManaged in interface AsyncContext
      Parameters:
      producer - response producer.
    • suspend

      public boolean suspend()
      Description copied from interface: AsyncContext
      Suspend the current asynchronous processing context. The method returns true if the context has been successfully suspended, false otherwise.
      Specified by:
      suspend in interface AsyncContext
      Returns:
      true if the request processing has been suspended successfully suspended, false otherwise.
    • resume

      public boolean resume(Object response)
      Specified by:
      resume in interface javax.ws.rs.container.AsyncResponse
    • resume

      public boolean resume(Throwable error)
      Specified by:
      resume in interface javax.ws.rs.container.AsyncResponse
    • resume

      private boolean resume(Runnable handler)
    • cancel

      public boolean cancel()
      Specified by:
      cancel in interface javax.ws.rs.container.AsyncResponse
    • cancel

      public boolean cancel(int retryAfter)
      Specified by:
      cancel in interface javax.ws.rs.container.AsyncResponse
    • cancel

      public boolean cancel(Date retryAfter)
      Specified by:
      cancel in interface javax.ws.rs.container.AsyncResponse
    • cancel

      private boolean cancel(Value<javax.ws.rs.core.Response> responseValue)
    • isRunning

      public boolean isRunning()
    • isSuspended

      public boolean isSuspended()
      Specified by:
      isSuspended in interface javax.ws.rs.container.AsyncResponse
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface javax.ws.rs.container.AsyncResponse
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface javax.ws.rs.container.AsyncResponse
    • setTimeout

      public boolean setTimeout(long time, TimeUnit unit)
      Specified by:
      setTimeout in interface javax.ws.rs.container.AsyncResponse
    • setTimeoutHandler

      public void setTimeoutHandler(javax.ws.rs.container.TimeoutHandler handler)
      Specified by:
      setTimeoutHandler in interface javax.ws.rs.container.AsyncResponse
    • register

      public Collection<Class<?>> register(Class<?> callback)
      Specified by:
      register in interface javax.ws.rs.container.AsyncResponse
    • register

      public Map<Class<?>,Collection<Class<?>>> register(Class<?> callback, Class<?>... callbacks)
      Specified by:
      register in interface javax.ws.rs.container.AsyncResponse
    • register

      public Collection<Class<?>> register(Object callback)
      Specified by:
      register in interface javax.ws.rs.container.AsyncResponse
    • register

      public Map<Class<?>,Collection<Class<?>>> register(Object callback, Object... callbacks)
      Specified by:
      register in interface javax.ws.rs.container.AsyncResponse