Package org.jboss.resteasy.spi
Interface AsyncWriterInterceptorContext
-
- All Superinterfaces:
InterceptorContext
- All Known Implementing Classes:
AbstractWriterInterceptorContext,ClientWriterInterceptorContext,ServerWriterInterceptorContext
public interface AsyncWriterInterceptorContext extends InterceptorContext
Context forAsyncWriterInterceptorwhich 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.AsyncOutputStreamgetAsyncOutputStream()Get the async output stream for the object to be written.ObjectgetEntity()Get object to be written as HTTP entity.MultivaluedMap<String,Object>getHeaders()Get mutable map of HTTP headers.voidsetAsyncOutputStream(AsyncOutputStream os)Set a new async output stream for the object to be written.voidsetEntity(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 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 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
CompletionStageindicating completion. - Throws:
IOException- if an IO error arises or is thrown by the wrappedAsyncMessageBodyWriter.asyncWriteTomethod, in the returnedCompletionStage.WebApplicationException- thrown by the wrappedAsyncMessageBodyWriter.asyncWriteTomethod, in the returnedCompletionStage.
-
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
MultivaluedMap<String,Object> getHeaders()
Get mutable map of HTTP headers.- Returns:
- map of HTTP headers.
-
-