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 TypeMethodDescriptionProceed 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.Get mutable map of HTTP headers.void
Set a new async output stream for the object to be written.void
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 wrappedAsyncMessageBodyWriter.asyncWriteTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], jakarta.ws.rs.core.MediaType, jakarta.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 wrappedAsyncMessageBodyWriter.asyncWriteTo
method, in the returnedCompletionStage
.jakarta.ws.rs.WebApplicationException
- thrown by the wrappedAsyncMessageBodyWriter.asyncWriteTo
method, in the returnedCompletionStage
.
-
getEntity
Object getEntity()Get object to be written as HTTP entity.- Returns:
- object to be written as HTTP entity.
-
setEntity
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
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
-