Interface AsyncWriterInterceptorContext

All Superinterfaces:
jakarta.ws.rs.ext.InterceptorContext
All Known Implementing Classes:
AbstractWriterInterceptorContext, ClientWriterInterceptorContext, ServerWriterInterceptorContext

public interface AsyncWriterInterceptorContext extends jakarta.ws.rs.ext.InterceptorContext
Context for AsyncWriterInterceptor which supports async IO.
  • Method Summary

    Modifier and Type
    Method
    Description
    Proceed to the next interceptor in the chain.
    Get the async output stream for the object to be written.
    Get object to be written as HTTP entity.
    jakarta.ws.rs.core.MultivaluedMap<String,Object>
    Get mutable map of HTTP headers.
    void
    Set a new async output stream for the object to be written.
    void
    setEntity(Object entity)
    Update object to be written as HTTP entity.

    Methods inherited from interface jakarta.ws.rs.ext.InterceptorContext

    getAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getType, hasProperty, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType
  • Method Details

    • asyncProceed

      CompletionStage<Void> asyncProceed()
      Proceed to the next interceptor in the chain. Interceptors MUST explicitly call this method to continue the execution chain; the call to this method in the last interceptor of the chain will invoke the wrapped AsyncMessageBodyWriter.asyncWriteTo(T, Class, Type, Annotation[], MediaType, MultivaluedMap, AsyncOutputStream) method.
      Returns:
      a CompletionStage indicating completion.
      Throws:
      IOException - if an IO error arises or is thrown by the wrapped AsyncMessageBodyWriter.asyncWriteTo method, in the returned CompletionStage.
      jakarta.ws.rs.WebApplicationException - thrown by the wrapped AsyncMessageBodyWriter.asyncWriteTo method, in the returned CompletionStage.
    • getEntity

      Object getEntity()
      Get object to be written as HTTP entity.
      Returns:
      object to be written as HTTP entity.
    • setEntity

      void setEntity(Object entity)
      Update object to be written as HTTP entity.
      Parameters:
      entity - new object to be written.
    • getAsyncOutputStream

      AsyncOutputStream getAsyncOutputStream()
      Get the async output stream for the object to be written. The runtime is responsible for closing the output stream.
      Returns:
      async output stream for the object to be written.
    • setAsyncOutputStream

      void setAsyncOutputStream(AsyncOutputStream os)
      Set a new async output stream for the object to be written. For example, by wrapping it with another async output stream. The runtime is responsible for closing the async output stream that is set.
      Parameters:
      os - new async output stream for the object to be written.
    • getHeaders

      jakarta.ws.rs.core.MultivaluedMap<String,Object> getHeaders()
      Get mutable map of HTTP headers.
      Returns:
      map of HTTP headers.