*/
private Destination getDestination(Bus bus, String address, Message message) throws IOException {
Destination destination = null;
DestinationFactoryManager factoryManager =
bus.getExtension(DestinationFactoryManager.class);
DestinationFactory factory =
factoryManager.getDestinationFactoryForUri(address);
if (factory != null) {
Endpoint ep = message.getExchange().get(Endpoint.class);
EndpointInfo ei = new EndpointInfo();
ei.setName(new QName(ep.getEndpointInfo().getName().getNamespaceURI(),
ep.getEndpointInfo().getName().getLocalPart() + ".decoupled"));
ei.setAddress(address);
destination = factory.getDestination(ei);
Conduit conduit = ContextUtils.getConduit(null, message);
if (conduit instanceof Observable) {
MessageObserver ob = ((Observable)conduit).getMessageObserver();
ob = new InterposedMessageObserver(bus, ob);
destination.setMessageObserver(ob);