Search in sources :

Example 1 with Observable

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;
}
Also used : Destination(org.apache.cxf.transport.Destination) DestinationFactory(org.apache.cxf.transport.DestinationFactory) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) MessageObserver(org.apache.cxf.transport.MessageObserver) DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) Endpoint(org.apache.cxf.endpoint.Endpoint) QName(javax.xml.namespace.QName) Conduit(org.apache.cxf.transport.Conduit) Observable(org.apache.cxf.transport.Observable)

Aggregations

QName (javax.xml.namespace.QName)1 Endpoint (org.apache.cxf.endpoint.Endpoint)1 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)1 Conduit (org.apache.cxf.transport.Conduit)1 Destination (org.apache.cxf.transport.Destination)1 DestinationFactory (org.apache.cxf.transport.DestinationFactory)1 DestinationFactoryManager (org.apache.cxf.transport.DestinationFactoryManager)1 MessageObserver (org.apache.cxf.transport.MessageObserver)1 Observable (org.apache.cxf.transport.Observable)1