Package org.jboss.resteasy.spi

## Interface AsyncWriterInterceptorContext

- All Superinterfaces:
    `javax.ws.rs.ext.InterceptorContext`
  All Known Implementing Classes:
    `AbstractWriterInterceptorContext`, `ClientWriterInterceptorContext`, `ServerWriterInterceptorContext`

      public interface AsyncWriterInterceptorContext
      extends javax.ws.rs.ext.InterceptorContext

  Context for `AsyncWriterInterceptor` which supports async IO.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CompletionStage<Void>` | `asyncProceed()` | Proceed to the next interceptor in the chain.
    `AsyncOutputStream` | `getAsyncOutputStream()` | Get the async output stream for the object to be written.
    `Object` | `getEntity()` | Get object to be written as HTTP entity.
    `javax.ws.rs.core.MultivaluedMap<String,​Object>` | `getHeaders()` | Get mutable map of HTTP headers.
    `void` | `setAsyncOutputStream​(AsyncOutputStream os)` | 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 javax.ws.rs.ext.InterceptorContext

      `getAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getType, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType`

- - ### Method Detail

    - #### 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, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, org.jboss.resteasy.spi.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`.
        `javax.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

          javax.ws.rs.core.MultivaluedMap<String,​Object> getHeaders()

      Get mutable map of HTTP headers.
      Returns:
        map of HTTP headers.