}
}
// TODO: this should be somewhere in org.apache.servicemix.jbi.messaging
protected MessageExchange getExchange(byte[] data) throws AuditorException {
ExchangePacket packet = null;
try {
packet = ExchangePacket.readPacket(data);
} catch (Exception e) {
throw new AuditorException("Unable to reconstruct exchange", e);
}
URI mep = packet.getPattern();
if (MessageExchangeSupport.IN_ONLY.equals(mep)) {
return new InOnlyImpl(packet);
} else if (MessageExchangeSupport.IN_OPTIONAL_OUT.equals(mep)) {
return new InOptionalOutImpl(packet);
} else if (MessageExchangeSupport.IN_OUT.equals(mep)) {