Exchange exchange = message.getExchange();
// add request-specific MAPs
boolean isOneway = exchange.isOneWay();
boolean isOutbound = ContextUtils.isOutbound(message);
Conduit conduit = null;
// To
if (maps.getTo() == null) {
if (isOutbound) {
conduit = ContextUtils.getConduit(conduit, message);
}
String s = (String)message.get(Message.ENDPOINT_ADDRESS);
EndpointReferenceType reference = conduit != null
? conduit.getTarget()
: ContextUtils.getNoneEndpointReference();
if (conduit != null && !StringUtils.isEmpty(s)
&& !reference.getAddress().getValue().equals(s)) {
EndpointReferenceType ref = new EndpointReferenceType();
AttributedURIType tp = new AttributedURIType();
tp.setValue(s);
ref.setAddress(tp);
ref.setMetadata(reference.getMetadata());
ref.setReferenceParameters(reference.getReferenceParameters());
ref.getOtherAttributes().putAll(reference.getOtherAttributes());
reference = ref;
}
maps.setTo(reference);
}
// ReplyTo, set if null in MAPs or if set to a generic address
// (anonymous or none) that may not be appropriate for the
// current invocation
EndpointReferenceType replyTo = maps.getReplyTo();
if (ContextUtils.isGenericAddress(replyTo)) {
conduit = ContextUtils.getConduit(conduit, message);
if (conduit != null) {
Destination backChannel = conduit.getBackChannel();
if (backChannel != null) {
replyTo = backChannel.getAddress();
}
}
if (replyTo == null