Fault fault = exchange.createFault();
exchange.setFault(fault);
exchange.setError((Exception) e.getCause());
StringWriter writer = new StringWriter();
jaxbContext.createMarshaller().marshal(new JbiFault(info), writer);
fault.setContent(new StringSource(writer.toString()));
channel.send(exchange);
return;
} else {
throw (Exception) e.getCause();
}
} else if (e.getCause() instanceof Error) {
throw (Error) e.getCause();
} else {
throw new RuntimeException(e.getCause());
}
}
if (oneWay) {
exchange.setStatus(ExchangeStatus.DONE);
channel.send(exchange);
} else {
NormalizedMessage msg = exchange.createMessage();
exchange.setMessage(msg, "out");
StringWriter writer = new StringWriter();
jaxbContext.createMarshaller().marshal(output, writer);
msg.setContent(new StringSource(writer.toString()));
channel.send(exchange);
}
}