String transportID = ei.getTransportId();
try {
ConduitInitiatorManager conduitInitiatorMgr = exchange.getBus()
.getExtension(ConduitInitiatorManager.class);
if (conduitInitiatorMgr != null) {
ConduitInitiator conduitInitiator =
conduitInitiatorMgr.getConduitInitiator(transportID);
if (conduitInitiator != null) {
String add = (String)message.get(Message.ENDPOINT_ADDRESS);
String basePath = (String)message.get(Message.BASE_PATH);
if (StringUtils.isEmpty(add)
|| add.equals(ei.getAddress())) {
c = conduitInitiator.getConduit(ei);
replaceEndpointAddressPropertyIfNeeded(message, add, c);
} else {
EndpointReferenceType epr = new EndpointReferenceType();
AttributedURIType ad = new AttributedURIType();
ad.setValue(StringUtils.isEmpty(basePath) ? add : basePath);
epr.setAddress(ad);
c = conduitInitiator.getConduit(ei, epr);
}
MessageObserver observer =
exchange.get(MessageObserver.class);
if (observer != null) {
c.setMessageObserver(observer);