Search in sources :

Example 1 with ConduitInitiatorManager

use of org.apache.cxf.transport.ConduitInitiatorManager in project camel by apache.

the class CamelTransportFactory method unregisterFactory.

public final void unregisterFactory() {
    if (null == bus) {
        return;
    }
    DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    if (null != dfm && getTransportIds() != null) {
        for (String ns : getTransportIds()) {
            try {
                if (dfm.getDestinationFactory(ns) == this) {
                    dfm.deregisterDestinationFactory(ns);
                }
            } catch (BusException e) {
            //ignore
            }
        }
    }
    ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
    if (cim != null && getTransportIds() != null) {
        for (String ns : getTransportIds()) {
            try {
                if (cim.getConduitInitiator(ns) == this) {
                    cim.deregisterConduitInitiator(ns);
                }
            } catch (BusException e) {
            //ignore
            }
        }
    }
}
Also used : DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager) BusException(org.apache.cxf.BusException)

Example 2 with ConduitInitiatorManager

use of org.apache.cxf.transport.ConduitInitiatorManager in project camel by apache.

the class CamelTransportTestSupport method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    BusFactory bf = BusFactory.newInstance();
    //setup the camel transport for the bus
    bus = bf.createBus();
    DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    CamelTransportFactory camelTransportFactory = new CamelTransportFactory();
    //set the context here to the transport factory;
    camelTransportFactory.setCamelContext(context);
    ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
    dfm.registerDestinationFactory(CamelTransportFactory.TRANSPORT_ID, camelTransportFactory);
    cim.registerConduitInitiator(CamelTransportFactory.TRANSPORT_ID, camelTransportFactory);
    BusFactory.setDefaultBus(bus);
    endpointInfo = new EndpointInfo();
}
Also used : EndpointInfo(org.apache.cxf.service.model.EndpointInfo) DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager) BusFactory(org.apache.cxf.BusFactory) Before(org.junit.Before)

Example 3 with ConduitInitiatorManager

use of org.apache.cxf.transport.ConduitInitiatorManager in project camel by apache.

the class CxfBeanEndpoint method registerTransportFactory.

private void registerTransportFactory(CxfBeanComponent cxfBeanComponent) {
    CxfBeanTransportFactory transportFactory = new CxfBeanTransportFactory();
    transportFactory.setCxfBeanComponent(cxfBeanComponent);
    transportFactory.setBus(bus);
    // register the conduit initiator
    ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
    cim.registerConduitInitiator(CxfBeanTransportFactory.TRANSPORT_ID, transportFactory);
    // register the destination factory
    DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    dfm.registerDestinationFactory(CxfBeanTransportFactory.TRANSPORT_ID, transportFactory);
}
Also used : DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager)

Example 4 with ConduitInitiatorManager

use of org.apache.cxf.transport.ConduitInitiatorManager in project camel by apache.

the class CamelTransportFactory method registerFactory.

public final void registerFactory() {
    if (null == bus) {
        return;
    }
    DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    if (null != dfm && getTransportIds() != null) {
        for (String ns : getTransportIds()) {
            dfm.registerDestinationFactory(ns, this);
        }
    }
    ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
    if (cim != null && getTransportIds() != null) {
        for (String ns : getTransportIds()) {
            cim.registerConduitInitiator(ns, this);
        }
    }
}
Also used : DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager)

Aggregations

ConduitInitiatorManager (org.apache.cxf.transport.ConduitInitiatorManager)4 DestinationFactoryManager (org.apache.cxf.transport.DestinationFactoryManager)4 BusException (org.apache.cxf.BusException)1 BusFactory (org.apache.cxf.BusFactory)1 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)1 Before (org.junit.Before)1