use of org.apache.cxf.transport.Observable in project cxf by apache.
the class MAPAggregatorImpl method getDestination.
/**
* @param address the address
* @return a Destination for the address
*/
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().getEndpoint();
EndpointInfo ei = new EndpointInfo();
ei.setName(new QName(ep.getEndpointInfo().getName().getNamespaceURI(), ep.getEndpointInfo().getName().getLocalPart() + ".decoupled"));
ei.setAddress(address);
destination = factory.getDestination(ei, bus);
Conduit conduit = ContextUtils.getConduit(null, message);
if (conduit != null) {
MessageObserver ob = ((Observable) conduit).getMessageObserver();
ob = new InterposedMessageObserver(bus, ob);
destination.setMessageObserver(ob);
}
}
return destination;
}
Aggregations