Interface SuspendableContainerRequestContext

All Superinterfaces:
jakarta.ws.rs.container.ContainerRequestContext
All Known Implementing Classes:
PostMatchContainerRequestContext, PreMatchContainerRequestContext, ResponseContainerRequestContext

public interface SuspendableContainerRequestContext extends jakarta.ws.rs.container.ContainerRequestContext
Suspendable request 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 request, and proceeds to the next request filter, if any, or to the resource method.
    void
    Aborts the current request with the given exception.
    void
    Suspends the current request.

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

    abortWith, containsHeaderString, containsHeaderString, getAcceptableLanguages, getAcceptableMediaTypes, getCookies, getDate, getEntityStream, getHeaders, getHeaderString, getLanguage, getLength, getMediaType, getMethod, getProperty, getPropertyNames, getRequest, getSecurityContext, getUriInfo, hasEntity, hasProperty, removeProperty, setEntityStream, setMethod, setProperty, setRequestUri, setRequestUri, setSecurityContext
  • Method Details

    • suspend

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

      void resume()
      Resumes the current request, and proceeds to the next request filter, if any, or to the resource method.
    • resume

      void resume(Throwable t)
      Aborts the current request with the given exception. This behaves as if the request filter threw this exception synchronously, which means exceptions may be mapped via exception mappers, response filters will run and async response callbacks will be called with this exception.
      Parameters:
      t - the exception to send back to the client, as mapped by the application.