Interface SuspendableContainerResponseContext

All Superinterfaces:
jakarta.ws.rs.container.ContainerResponseContext
All Known Implementing Classes:
ContainerResponseContextImpl

public interface SuspendableContainerResponseContext extends jakarta.ws.rs.container.ContainerResponseContext
Suspendable response context, which allows the users to suspend execution of the filter chain until it is resumed normally, or abnormally with a Throwable.
Author:
Stéphane Épardaud
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Resumes the current response, and proceeds to the next response filter, if any, or to send the response.
    void
    Aborts the current response with the given exception.
    void
    Suspends the current response.

    Methods inherited from interface jakarta.ws.rs.container.ContainerResponseContext

    getAllowedMethods, getCookies, getDate, getEntity, getEntityAnnotations, getEntityClass, getEntityStream, getEntityTag, getEntityType, getHeaders, getHeaderString, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getStatus, getStatusInfo, getStringHeaders, hasEntity, hasLink, setEntity, setEntity, setEntityStream, setStatus, setStatusInfo
  • Method Details

    • suspend

      void suspend()
      Suspends the current response. This makes the current request asynchronous. No further response filter is executed until this response is resumed. No reply is going to be sent to the client until this response is resumed either with resume() or aborted with resume(Throwable) or ResponseContainerRequestContext.abortWith(jakarta.ws.rs.core.Response).
    • resume

      void resume()
      Resumes the current response, and proceeds to the next response filter, if any, or to send the response.
    • resume

      void resume(Throwable t)
      Aborts the current response with the given exception. This behaves as if the request filter threw this exception synchronously, which means that the exception will not be mapped by exception mappers, the response filters will stop running, and the async response callbacks will be called with this exception.
      Parameters:
      t - the exception to send back to the client, as an internal server error.