/** * Perform any actions required on stream flush (freeze headers, * reset output stream ... etc.) */ protected void onFirstWrite() throws IOException { OutputStream responseStream = flushHeaders(outMessage); if (null != responseStream) { wrappedStream = responseStream; } }
protected OutputStream flushHeaders(Message outMessage) throws IOException { return flushHeaders(outMessage, true); } protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException {
/** * Perform any actions required on stream closure (handle response etc.) */ public void close() throws IOException { if (!written && wrappedStream == null) { OutputStream responseStream = flushHeaders(outMessage, false); if (null != responseStream) { wrappedStream = responseStream; } } if (wrappedStream != null) { // closing the stream should indirectly call the servlet response's flushBuffer wrappedStream.close(); } /* try { //make sure the input stream is also closed in this //case so that any resources it may have is cleaned up Message m = outMessage.getExchange().getInMessage(); if (m != null) { InputStream ins = m.getContent(InputStream.class); if (ins != null) { ins.close(); } } } catch (IOException ex) { //ignore } */ }
/** * Perform any actions required on stream flush (freeze headers, * reset output stream ... etc.) */ protected void onFirstWrite() throws IOException { OutputStream responseStream = flushHeaders(outMessage); if (null != responseStream) { wrappedStream = responseStream; } }
/** * Perform any actions required on stream flush (freeze headers, * reset output stream ... etc.) */ protected void onFirstWrite() throws IOException { OutputStream responseStream = flushHeaders(outMessage); if (null != responseStream) { wrappedStream = responseStream; } }
protected OutputStream flushHeaders(Message outMessage) throws IOException { return flushHeaders(outMessage, true); } protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException {
protected OutputStream flushHeaders(Message outMessage) throws IOException { return flushHeaders(outMessage, true); } protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException {
/** * Perform any actions required on stream closure (handle response etc.) */ public void close() throws IOException { if (!written && wrappedStream == null) { OutputStream responseStream = flushHeaders(outMessage, false); if (null != responseStream) { wrappedStream = responseStream; } } if (wrappedStream != null) { // closing the stream should indirectly call the servlet response's flushBuffer wrappedStream.close(); } /* try { //make sure the input stream is also closed in this //case so that any resources it may have is cleaned up Message m = outMessage.getExchange().getInMessage(); if (m != null) { InputStream ins = m.getContent(InputStream.class); if (ins != null) { ins.close(); } } } catch (IOException ex) { //ignore } */ }
protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException { OutputStream out = super.flushHeaders(outMessage, getStream); return wrapOutput(out); }
/** * Perform any actions required on stream closure (handle response etc.) */ public void close() throws IOException { if (!written && wrappedStream == null) { OutputStream responseStream = flushHeaders(outMessage, false); if (null != responseStream) { wrappedStream = responseStream; } } if (wrappedStream != null) { wrappedStream.close(); response.flushBuffer(); } /* try { //make sure the input stream is also closed in this //case so that any resources it may have is cleaned up Message m = outMessage.getExchange().getInMessage(); if (m != null) { InputStream ins = m.getContent(InputStream.class); if (ins != null) { ins.close(); } } } catch (IOException ex) { //ignore } */ }