public void proceed() throws IOException, WebApplicationException { LogMessages.LOGGER.debugf("Interceptor Context: %s, Method : proceed", getClass().getName()); if (interceptors == null || index >= interceptors.length) { MessageBodyWriter writer = getWriter(); if (writer!=null) { tracingLogger.log("MBW_WRITE_TO", writer.getClass().getName()); LogMessages.LOGGER.debugf("MessageBodyWriter: %s", writer.getClass().getName()); } writeTo(writer); } else { LogMessages.LOGGER.debugf("WriterInterceptor: %s", interceptors[index].getClass().getName()); int x = index; traceBefore(interceptors[x]); try { interceptors[index++].aroundWriteTo(this); } finally { traceAfter(interceptors[x]); } // we used to pop the index, but the TCK doesn't like this } }
protected MessageBodyWriter getWriter() { MessageBodyWriter writer = resolveWriter(); if (writer == null) { throwWriterNotFoundException(); } return writer; }
final long timestamp = tracingLogger.timestamp("WI_SUMMARY"); try { writerContext.proceed(); } finally { tracingLogger.logDuration("WI_SUMMARY", timestamp, writerContext.getProcessedInterceptorCount()); response.setOutputStream(writerContext.getOutputStream()); //propagate interceptor changes on the outputstream to the response
public void writeRequestBody(OutputStream outputStream) throws IOException { if (entity == null) { return; } WriterInterceptor[] interceptors = getWriterInterceptors(); AbstractWriterInterceptorContext ctx = new ClientWriterInterceptorContext(interceptors, configuration.getProviderFactory(), entity, entityClass, entityGenericType, entityAnnotations, headers.getMediaType(), headers.getHeaders(), outputStream, getMutableProperties(), tracingLogger); final long timestamp = tracingLogger.timestamp("WI_SUMMARY"); try { ctx.proceed(); } finally { tracingLogger.logDuration("WI_SUMMARY", timestamp, ctx.getProcessedInterceptorCount()); } }
public void doWrite(Object toOutput, Class type, Type genericType, MediaType mediaType, Annotation[] annotations, MultivaluedMap<String, Object> requestHeaders, OutputStream outputStream) throws IOException { final Map<String, Object> attributes = new HashMap<String, Object>(); AbstractWriterInterceptorContext messageBodyWriterContext = new ClientWriterInterceptorContext(interceptors, factory, toOutput, type, genericType, annotations, mediaType, requestHeaders, outputStream, attributes); messageBodyWriterContext .proceed(); }
@Override protected void writeTo(MessageBodyWriter writer) throws IOException { super.writeTo(writer); }
final long timestamp = tracingLogger.timestamp("WI_SUMMARY"); try { writerContext.proceed(); } finally { tracingLogger.logDuration("WI_SUMMARY", timestamp, writerContext.getProcessedInterceptorCount()); response.setOutputStream(writerContext.getOutputStream()); //propagate interceptor changes on the outputstream to the response
public void doWrite(Object toOutput, Class type, Type genericType, MediaType mediaType, Annotation[] annotations, MultivaluedMap<String, Object> requestHeaders, OutputStream outputStream) throws IOException { final Map<String, Object> attributes = new HashMap<String, Object>(); AbstractWriterInterceptorContext messageBodyWriterContext = new ClientWriterInterceptorContext(interceptors, factory, toOutput, type, genericType, annotations, mediaType, requestHeaders, outputStream, attributes); messageBodyWriterContext .proceed(); }
@Override protected void writeTo(MessageBodyWriter writer) throws IOException { super.writeTo(writer); }
public void proceed() throws IOException, WebApplicationException { LogMessages.LOGGER.debugf("Interceptor Context: %s, Method : proceed", getClass().getName()); if (interceptors == null || index >= interceptors.length) { MessageBodyWriter writer = getWriter(); if (writer!=null) { tracingLogger.log("MBW_WRITE_TO", writer.getClass().getName()); LogMessages.LOGGER.debugf("MessageBodyWriter: %s", writer.getClass().getName()); } writeTo(writer); } else { LogMessages.LOGGER.debugf("WriterInterceptor: %s", interceptors[index].getClass().getName()); int x = index; traceBefore(interceptors[x]); try { interceptors[index++].aroundWriteTo(this); } finally { traceAfter(interceptors[x]); } // we used to pop the index, but the TCK doesn't like this } }
protected MessageBodyWriter getWriter() { MessageBodyWriter writer = resolveWriter(); if (writer == null) { throwWriterNotFoundException(); } return writer; }