exchanges.notifyAll();
}
if (exchange.getStatus() == Status.Active) {
String key = exchange.getIn().getBody(String.class);
if (sendFault && key != null && !faultSent.containsKey(key)) {
exchange.getFault().setBody(new StringSource("<fault/>"));
channel.send(exchange);
faultSent.put(key, true);
} else if (sendError && key != null && !errorSent.containsKey(key)) {
exchange.setError(new Exception("error"));
exchange.setStatus(Status.Error);
channel.send(exchange);
errorSent.put(key, true);
} else if (exchange.getPattern() == Pattern.InOut || exchange.getPattern() == Pattern.InOptionalOut) {
exchange.getOut().setBody(new StringSource("<out/>"));
channel.send(exchange);
} else {
exchange.setStatus(Status.Done);
channel.send(exchange);
}