Class AbstractWriterInterceptorContext
java.lang.Object
org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext
- All Implemented Interfaces:
jakarta.ws.rs.ext.InterceptorContext
,jakarta.ws.rs.ext.WriterInterceptorContext
,AsyncWriterInterceptorContext
- Direct Known Subclasses:
ClientWriterInterceptorContext
,ServerWriterInterceptorContext
public abstract class AbstractWriterInterceptorContext
extends Object
implements jakarta.ws.rs.ext.WriterInterceptorContext, AsyncWriterInterceptorContext
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Modifier and TypeFieldDescriptionprotected Annotation[]
protected Object
protected Type
protected int
protected jakarta.ws.rs.ext.WriterInterceptor[]
protected jakarta.ws.rs.core.MediaType
protected OutputStream
protected ResteasyProviderFactory
protected boolean
protected RESTEasyTracingLogger
protected Class
-
Constructor Summary
ConstructorDescriptionAbstractWriterInterceptorContext
(jakarta.ws.rs.ext.WriterInterceptor[] interceptors, Annotation[] annotations, Object entity, Type genericType, jakarta.ws.rs.core.MediaType mediaType, Class type, OutputStream outputStream, ResteasyProviderFactory providerFactory, jakarta.ws.rs.core.MultivaluedMap<String, Object> headers) Deprecated.AbstractWriterInterceptorContext
(jakarta.ws.rs.ext.WriterInterceptor[] interceptors, Annotation[] annotations, Object entity, Type genericType, jakarta.ws.rs.core.MediaType mediaType, Class type, OutputStream outputStream, ResteasyProviderFactory providerFactory, jakarta.ws.rs.core.MultivaluedMap<String, Object> headers, RESTEasyTracingLogger logger) -
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.jakarta.ws.rs.core.MediaType
int
getType()
protected jakarta.ws.rs.ext.MessageBodyWriter
protected boolean
void
proceed()
protected abstract jakarta.ws.rs.ext.MessageBodyWriter
void
setAnnotations
(Annotation[] annotations) void
setAsyncOutputStream
(AsyncOutputStream asyncOutputStream) Set a new async output stream for the object to be written.void
Update object to be written as HTTP entity.void
setGenericType
(Type genericType) void
setMediaType
(jakarta.ws.rs.core.MediaType mediaType) void
setOutputStream
(OutputStream outputStream) void
protected final void
traceAfter
(jakarta.ws.rs.ext.WriterInterceptor interceptor) protected final void
traceBefore
(jakarta.ws.rs.ext.WriterInterceptor interceptor) protected CompletionStage
<Void> writeTo
(jakarta.ws.rs.ext.MessageBodyWriter writer) protected CompletionStage
<Void> writeTo
(AsyncMessageBodyWriter writer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.ws.rs.ext.InterceptorContext
getProperty, getPropertyNames, hasProperty, removeProperty, setProperty
-
Field Details
-
tracingLogger
-
interceptors
protected jakarta.ws.rs.ext.WriterInterceptor[] interceptors -
requireAsyncIO
protected boolean requireAsyncIO -
entity
-
type
-
genericType
-
annotations
-
mediaType
protected jakarta.ws.rs.core.MediaType mediaType -
headers
-
outputStream
-
index
protected int index -
providerFactory
-
-
Constructor Details
-
AbstractWriterInterceptorContext
@Deprecated public AbstractWriterInterceptorContext(jakarta.ws.rs.ext.WriterInterceptor[] interceptors, Annotation[] annotations, Object entity, Type genericType, jakarta.ws.rs.core.MediaType mediaType, Class type, OutputStream outputStream, ResteasyProviderFactory providerFactory, jakarta.ws.rs.core.MultivaluedMap<String, Object> headers) Deprecated. -
AbstractWriterInterceptorContext
public AbstractWriterInterceptorContext(jakarta.ws.rs.ext.WriterInterceptor[] interceptors, Annotation[] annotations, Object entity, Type genericType, jakarta.ws.rs.core.MediaType mediaType, Class type, OutputStream outputStream, ResteasyProviderFactory providerFactory, jakarta.ws.rs.core.MultivaluedMap<String, Object> headers, RESTEasyTracingLogger logger)
-
-
Method Details
-
getProcessedInterceptorCount
public int getProcessedInterceptorCount() -
getEntity
Description copied from interface:AsyncWriterInterceptorContext
Get object to be written as HTTP entity.- Specified by:
getEntity
in interfaceAsyncWriterInterceptorContext
- Specified by:
getEntity
in interfacejakarta.ws.rs.ext.WriterInterceptorContext
- Returns:
- object to be written as HTTP entity.
-
setEntity
Description copied from interface:AsyncWriterInterceptorContext
Update object to be written as HTTP entity.- Specified by:
setEntity
in interfaceAsyncWriterInterceptorContext
- Specified by:
setEntity
in interfacejakarta.ws.rs.ext.WriterInterceptorContext
- Parameters:
entity
- new object to be written.
-
getType
- Specified by:
getType
in interfacejakarta.ws.rs.ext.InterceptorContext
-
setType
- Specified by:
setType
in interfacejakarta.ws.rs.ext.InterceptorContext
-
getGenericType
- Specified by:
getGenericType
in interfacejakarta.ws.rs.ext.InterceptorContext
-
setGenericType
- Specified by:
setGenericType
in interfacejakarta.ws.rs.ext.InterceptorContext
-
getAnnotations
- Specified by:
getAnnotations
in interfacejakarta.ws.rs.ext.InterceptorContext
-
setAnnotations
- Specified by:
setAnnotations
in interfacejakarta.ws.rs.ext.InterceptorContext
-
getMediaType
public jakarta.ws.rs.core.MediaType getMediaType()- Specified by:
getMediaType
in interfacejakarta.ws.rs.ext.InterceptorContext
-
setMediaType
public void setMediaType(jakarta.ws.rs.core.MediaType mediaType) - Specified by:
setMediaType
in interfacejakarta.ws.rs.ext.InterceptorContext
-
getHeaders
Description copied from interface:AsyncWriterInterceptorContext
Get mutable map of HTTP headers.- Specified by:
getHeaders
in interfaceAsyncWriterInterceptorContext
- Specified by:
getHeaders
in interfacejakarta.ws.rs.ext.WriterInterceptorContext
- Returns:
- map of HTTP headers.
-
getOutputStream
- Specified by:
getOutputStream
in interfacejakarta.ws.rs.ext.WriterInterceptorContext
-
setOutputStream
- Specified by:
setOutputStream
in interfacejakarta.ws.rs.ext.WriterInterceptorContext
-
setAsyncOutputStream
Description copied from interface:AsyncWriterInterceptorContext
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.- Specified by:
setAsyncOutputStream
in interfaceAsyncWriterInterceptorContext
- Parameters:
asyncOutputStream
- new async output stream for the object to be written.
-
getAsyncOutputStream
Description copied from interface:AsyncWriterInterceptorContext
Get the async output stream for the object to be written. The runtime is responsible for closing the output stream.- Specified by:
getAsyncOutputStream
in interfaceAsyncWriterInterceptorContext
- Returns:
- async output stream for the object to be written.
-
getStarted
-
preferAsyncIo
protected boolean preferAsyncIo() -
asyncProceed
Description copied from interface:AsyncWriterInterceptorContext
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.- Specified by:
asyncProceed
in interfaceAsyncWriterInterceptorContext
- Returns:
- a
CompletionStage
indicating completion.
-
proceed
- Specified by:
proceed
in interfacejakarta.ws.rs.ext.WriterInterceptorContext
- Throws:
IOException
jakarta.ws.rs.WebApplicationException
-
syncProceed
public CompletionStage<Void> syncProceed() throws IOException, jakarta.ws.rs.WebApplicationException- Throws:
IOException
jakarta.ws.rs.WebApplicationException
-
traceBefore
protected final void traceBefore(jakarta.ws.rs.ext.WriterInterceptor interceptor) -
traceAfter
protected final void traceAfter(jakarta.ws.rs.ext.WriterInterceptor interceptor) -
writeTo
protected CompletionStage<Void> writeTo(jakarta.ws.rs.ext.MessageBodyWriter writer) throws IOException - Throws:
IOException
-
writeTo
-
getWriter
protected jakarta.ws.rs.ext.MessageBodyWriter getWriter() -
resolveWriter
protected abstract jakarta.ws.rs.ext.MessageBodyWriter resolveWriter()
-