org.glassfish.jersey.message.internal
Class ReaderInterceptorExecutor
java.lang.Object
org.glassfish.jersey.message.internal.ReaderInterceptorExecutor
- All Implemented Interfaces:
- InterceptorContext, ReaderInterceptorContext
public class ReaderInterceptorExecutor
- extends java.lang.Object
- implements ReaderInterceptorContext
Entry point of the reader interceptor chain. It contstructs the chain of wrapped
interceptor and invokes it. At the end of the chain MBW
is invoked which writes the entity to the output stream. The
ExceptionWrapperInterceptor is always invoked on the client as a first
interceptor.
- Author:
- Miroslav Fuksa (miroslav.fuksa at oracle.com)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.ws.rs.ext.InterceptorContext |
getAnnotations, getGenericType, getMediaType, getProperty, getPropertyNames, getType, removeProperty, setAnnotations, setGenericType, setMediaType, setProperty, setType |
ReaderInterceptorExecutor
public ReaderInterceptorExecutor(java.lang.Class<?> rawType,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<java.lang.String,java.lang.String> headers,
PropertiesDelegate propertiesDelegate,
java.io.InputStream inputStream,
MessageBodyWorkers workers,
boolean intercept)
- Reads a type from the
entityStream using interceptors.
- Parameters:
rawType - raw Java entity type.type - generic Java entity type.annotations - an array of the 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 - the media type of the HTTP entity.headers - mutable message headers.propertiesDelegate - a request-scoped properties delegate.inputStream - entity stream.workers - Message body workers.intercept - true if the user interceptors should be executed. Otherwise only
exception wrapping interceptor will
be executed in the client.
getNextInterceptor
public ReaderInterceptor getNextInterceptor()
- Returns next
interceptor in the chain. Stateful method.
- Returns:
- Next interceptor.
proceed
public java.lang.Object proceed()
throws java.io.IOException
- Starts the interceptor chain execution.
- Specified by:
proceed in interface ReaderInterceptorContext
- Returns:
- an entity read from the stream.
- Throws:
java.io.IOException
getInputStream
public java.io.InputStream getInputStream()
- Specified by:
getInputStream in interface ReaderInterceptorContext
setInputStream
public void setInputStream(java.io.InputStream is)
- Specified by:
setInputStream in interface ReaderInterceptorContext
getHeaders
public MultivaluedMap<java.lang.String,java.lang.String> getHeaders()
- Specified by:
getHeaders in interface ReaderInterceptorContext
getProperty
public java.lang.Object getProperty(java.lang.String name)
- Specified by:
getProperty in interface InterceptorContext
getPropertyNames
public java.util.Enumeration<java.lang.String> getPropertyNames()
- Specified by:
getPropertyNames in interface InterceptorContext
setProperty
public void setProperty(java.lang.String name,
java.lang.Object object)
- Specified by:
setProperty in interface InterceptorContext
removeProperty
public void removeProperty(java.lang.String name)
- Specified by:
removeProperty in interface InterceptorContext
getAnnotations
public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotations in interface InterceptorContext
setAnnotations
public void setAnnotations(java.lang.annotation.Annotation[] annotations)
- Specified by:
setAnnotations in interface InterceptorContext
getType
public java.lang.Class getType()
- Specified by:
getType in interface InterceptorContext
setType
public void setType(java.lang.Class type)
- Specified by:
setType in interface InterceptorContext
getGenericType
public java.lang.reflect.Type getGenericType()
- Specified by:
getGenericType in interface InterceptorContext
setGenericType
public void setGenericType(java.lang.reflect.Type genericType)
- Specified by:
setGenericType in interface InterceptorContext
getMediaType
public MediaType getMediaType()
- Specified by:
getMediaType in interface InterceptorContext
setMediaType
public void setMediaType(MediaType mediaType)
- Specified by:
setMediaType in interface InterceptorContext
Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.