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
}
}
}
}
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();
}
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);
}
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);
}
}
}
Aggregations