use of org.apache.cxf.jaxrs.impl.ReaderInterceptorContextImpl in project cxf by apache.
the class XmlSecInInterceptor method aroundReadFrom.
@Override
public Object aroundReadFrom(ReaderInterceptorContext ctx) throws IOException, WebApplicationException {
Message message = ((ReaderInterceptorContextImpl) ctx).getMessage();
if (!canDocumentBeRead(message)) {
return ctx.proceed();
}
prepareMessage(message);
Object object = ctx.proceed();
new StaxActionInInterceptor(requireSignature, requireEncryption).handleMessage(message);
return object;
}
use of org.apache.cxf.jaxrs.impl.ReaderInterceptorContextImpl in project cxf by apache.
the class JAXRSUtils method readFromMessageBodyReader.
@SuppressWarnings("unchecked")
public static Object readFromMessageBodyReader(List<ReaderInterceptor> readers, Class<?> targetTypeClass, Type parameterType, Annotation[] parameterAnnotations, InputStream is, MediaType mediaType, Message m) throws IOException, WebApplicationException {
// Verbose but avoids an extra context instantiation for the typical path
if (readers.size() > 1) {
ReaderInterceptor first = readers.remove(0);
ReaderInterceptorContext context = new ReaderInterceptorContextImpl(targetTypeClass, parameterType, parameterAnnotations, is, m, readers);
return first.aroundReadFrom(context);
}
MessageBodyReader<?> provider = ((ReaderInterceptorMBR) readers.get(0)).getMBR();
@SuppressWarnings("rawtypes") Class cls = targetTypeClass;
return provider.readFrom(cls, parameterType, parameterAnnotations, mediaType, new HttpHeadersImpl(m).getRequestHeaders(), is);
}
Aggregations