} catch (InterruptedException ignore) {}
}
}
if (!completed) {
OutputStream out = new ContentOutputStream(outputBuffer);
try {
messageFormatter.writeTo(msgContext, format, out, false);
} catch (Exception e) {
Throwable t = e.getCause();
if (t != null && t.getCause() != null && t.getCause() instanceof ClosedChannelException) {
if (log.isDebugEnabled()) {
log.debug("Ignore closed channel exception, as the " +
"SessionRequestCallback handles this exception");
}
} else {
if (e instanceof AxisFault) {
throw (AxisFault) e;
} else {
handleException("Error streaming message context", e);
}
}
}
finally {
try {
out.flush();
out.close();
} catch (IOException e) {
handleException("Error closing outgoing message stream", e);
}
}
}