Class ReaderInterceptorExecutor

  • All Implemented Interfaces:
    javax.ws.rs.ext.InterceptorContext, javax.ws.rs.ext.ReaderInterceptorContext, InjectionManagerSupplier, PropertiesDelegate

    public final class ReaderInterceptorExecutor
    extends InterceptorExecutor<javax.ws.rs.ext.ReaderInterceptor>
    implements javax.ws.rs.ext.ReaderInterceptorContext, InjectionManagerSupplier
    Represents reader interceptor chain executor for both client and server side. It constructs wrapped interceptor chain and invokes it. At the end of the chain a message body reader execution interceptor is inserted, which finally reads an entity from the output stream provided by the chain.
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • headers

        private final javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> headers
      • interceptors

        private final java.util.Iterator<javax.ws.rs.ext.ReaderInterceptor> interceptors
      • translateNce

        private final boolean translateNce
      • inputStream

        private java.io.InputStream inputStream
      • processedCount

        private int processedCount
    • Constructor Detail

      • ReaderInterceptorExecutor

        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,
                                  InjectionManager injectionManager)
        Constructs a new executor to read given type from provided entityStream.
        Parameters:
        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 by
        injectionManager - injection manager.
    • Method Detail

      • proceed

        public java.lang.Object proceed()
                                 throws java.io.IOException
        Starts the interceptor chain execution.
        Specified by:
        proceed in interface javax.ws.rs.ext.ReaderInterceptorContext
        Returns:
        an entity read from the stream.
        Throws:
        java.io.IOException
      • getInputStream

        public java.io.InputStream getInputStream()
        Specified by:
        getInputStream in interface javax.ws.rs.ext.ReaderInterceptorContext
      • setInputStream

        public void setInputStream​(java.io.InputStream is)
        Specified by:
        setInputStream in interface javax.ws.rs.ext.ReaderInterceptorContext
      • getHeaders

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getHeaders()
        Specified by:
        getHeaders in interface javax.ws.rs.ext.ReaderInterceptorContext
      • getProcessedCount

        int getProcessedCount()
        Get number of processed interceptors.
        Returns:
        number of processed interceptors.