public final class ReaderInterceptorExecutor extends InterceptorExecutor<javax.ws.rs.ext.ReaderInterceptor> implements javax.ws.rs.ext.ReaderInterceptorContext, ServiceLocatorSupplier
message body reader execution interceptor is inserted,
which finally reads an entity from the output stream provided by the chain.| Modifier and Type | Class and Description |
|---|---|
private class |
ReaderInterceptorExecutor.TerminalReaderInterceptor
Terminal reader interceptor which choose the appropriate
MessageBodyReader
and reads the entity from the input stream. |
private static class |
ReaderInterceptorExecutor.UnCloseableInputStream
MessageBodyReaders should not close the given stream. |
| Modifier and Type | Field and Description |
|---|---|
private javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> |
headers |
private java.io.InputStream |
inputStream |
private java.util.Iterator<javax.ws.rs.ext.ReaderInterceptor> |
interceptors |
private static java.util.logging.Logger |
LOGGER |
private int |
processedCount |
private org.glassfish.hk2.api.ServiceLocator |
serviceLocator |
private boolean |
translateNce |
private MessageBodyWorkers |
workers |
| Constructor and Description |
|---|
ReaderInterceptorExecutor(java.lang.Class<?> rawType,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers,
PropertiesDelegate propertiesDelegate,
java.io.InputStream inputStream,
MessageBodyWorkers workers,
java.lang.Iterable<javax.ws.rs.ext.ReaderInterceptor> readerInterceptors,
boolean translateNce,
org.glassfish.hk2.api.ServiceLocator serviceLocator)
Constructs a new executor to read given type from provided
entityStream. |
| Modifier and Type | Method and Description |
|---|---|
static java.io.InputStream |
closeableInputStream(java.io.InputStream inputStream)
Make the
InputStream able to close. |
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> |
getHeaders() |
java.io.InputStream |
getInputStream() |
(package private) int |
getProcessedCount()
Get number of processed interceptors.
|
org.glassfish.hk2.api.ServiceLocator |
getServiceLocator()
Get service locator.
|
java.lang.Object |
proceed()
Starts the interceptor chain execution.
|
void |
setInputStream(java.io.InputStream is) |
clearLastTracedInterceptor, getAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getTracingLogger, getType, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType, traceAfter, traceBeforeprivate static final java.util.logging.Logger LOGGER
private final javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers
private final java.util.Iterator<javax.ws.rs.ext.ReaderInterceptor> interceptors
private final MessageBodyWorkers workers
private final boolean translateNce
private final org.glassfish.hk2.api.ServiceLocator serviceLocator
private java.io.InputStream inputStream
private int processedCount
public ReaderInterceptorExecutor(java.lang.Class<?> rawType,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers,
PropertiesDelegate propertiesDelegate,
java.io.InputStream inputStream,
MessageBodyWorkers workers,
java.lang.Iterable<javax.ws.rs.ext.ReaderInterceptor> readerInterceptors,
boolean translateNce,
org.glassfish.hk2.api.ServiceLocator serviceLocator)
entityStream.rawType - raw Java entity type.type - generic Java entity type.annotations - array of annotations on the declaration of the artifact
that will be initialized with the produced instance. E.g. if the message
body is to be converted into a method parameter, this will be the annotations
on that parameter returned by Method.getParameterAnnotations.mediaType - media type of the HTTP entity.headers - mutable message headers.propertiesDelegate - request-scoped properties delegate.inputStream - entity input stream.workers - Message body workers.readerInterceptors - Reader interceptor that are to be used to intercept the reading of an entity.
The interceptors will be executed in the same order as given in this parameter.translateNce - if true, the NoContentException thrown by a selected message
body
reader will be translated into a BadRequestException as required byserviceLocator - Service locator.public java.lang.Object proceed()
throws java.io.IOException
proceed in interface javax.ws.rs.ext.ReaderInterceptorContextjava.io.IOExceptionpublic java.io.InputStream getInputStream()
getInputStream in interface javax.ws.rs.ext.ReaderInterceptorContextpublic void setInputStream(java.io.InputStream is)
setInputStream in interface javax.ws.rs.ext.ReaderInterceptorContextpublic javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getHeaders()
getHeaders in interface javax.ws.rs.ext.ReaderInterceptorContextint getProcessedCount()
public org.glassfish.hk2.api.ServiceLocator getServiceLocator()
ServiceLocatorSuppliergetServiceLocator in interface ServiceLocatorSupplierpublic static java.io.InputStream closeableInputStream(java.io.InputStream inputStream)
InputStream able to close.
The purpose of this utility method is to undo effect of ReaderInterceptorExecutor.UnCloseableInputStream.inputStream - Potential ReaderInterceptorExecutor.UnCloseableInputStream to undo its effect