本文整理汇总了Java中org.apache.cxf.transport.DestinationFactoryManager类的典型用法代码示例。如果您正苦于以下问题:Java DestinationFactoryManager类的具体用法?Java DestinationFactoryManager怎么用?Java DestinationFactoryManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DestinationFactoryManager类属于org.apache.cxf.transport包,在下文中一共展示了DestinationFactoryManager类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.cxf.transport.DestinationFactoryManager; //导入依赖的package包/类
@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();
}
示例2: registerTransportFactory
import org.apache.cxf.transport.DestinationFactoryManager; //导入依赖的package包/类
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);
}
示例3: getDestinationRegistryFromBus
import org.apache.cxf.transport.DestinationFactoryManager; //导入依赖的package包/类
private static DestinationRegistry getDestinationRegistryFromBus(Bus bus) throws ServletException {
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
try {
DestinationFactory df = dfm
.getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
if (df instanceof HTTPTransportFactory) {
HTTPTransportFactory transportFactory = (HTTPTransportFactory)df;
return transportFactory.getRegistry();
}
} catch (BusException e) {
throw Messages.MESSAGES.cannotObtainDestinationFactoryForHttpTransport(e);
}
return null;
}
示例4: handleRequest
import org.apache.cxf.transport.DestinationFactoryManager; //导入依赖的package包/类
@Nullable
@Override
public ModelAndView handleRequest(HttpServletRequest servletReq, HttpServletResponse servletResp) throws Exception {
String destPath = StringUtils.prependIfMissing(
StringUtils.removeStart(((String) servletReq.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE)), this.baseUrlPath),
SdcctStringUtils.SLASH), txId;
DestinationRegistry destReg =
((HTTPTransportFactory) this.bus.getExtension(DestinationFactoryManager.class).getDestinationFactoryForUri(HTTP_TRANSPORT_NS_URI)).getRegistry();
AbstractHTTPDestination dest = destReg.getDestinationForPath(destPath, true);
if (dest == null) {
dest = destReg.checkRestfulRequest(destPath);
}
if (dest != null) {
servletReq.setAttribute(ENDPOINT_ADDR_SERVLET_REQ_ATTR_NAME, (this.baseUrlPath + dest.getEndpointInfo().getAddress()));
try {
MDC.put(SdcctPropertyNames.WS_SERVER_TX_ID, (txId = this.txIdGen.generateId().toString()));
servletReq.setAttribute(SdcctPropertyNames.HTTP_SERVER_TX_ID, txId);
BusFactory.setThreadDefaultBus(bus);
dest.invoke(this.servletConfig, this.servletContext, servletReq, servletResp);
} finally {
BusFactory.setThreadDefaultBus(null);
MDC.remove(SdcctPropertyNames.WS_SERVER_TX_ID);
}
} else {
// TODO: improve error handling
LOGGER.error(String.format("Unable to determine CXF destination (path=%s) for request.", destPath));
servletResp.setStatus(HttpStatus.NOT_FOUND.value());
}
return null;
}
示例5: afterPropertiesSet
import org.apache.cxf.transport.DestinationFactoryManager; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
this.bus.getExtension(ResourceManager.class).addResourceResolver(new ServletContextResourceResolver(this.servletConfig.getServletContext()));
this.servletController =
new ServiceServletController(((HTTPTransportFactory) this.bus.getExtension(DestinationFactoryManager.class).getDestinationFactoryForUri(
HTTPTransportFactory.DEFAULT_NAMESPACES.get(0))).getRegistry());
}
示例6: getDestinationRegistryFromBus
import org.apache.cxf.transport.DestinationFactoryManager; //导入依赖的package包/类
private static DestinationRegistry getDestinationRegistryFromBus(Bus bus) {
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
try {
DestinationFactory df = dfm.getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
if (df instanceof HTTPTransportFactory) {
HTTPTransportFactory transportFactory = (HTTPTransportFactory) df;
return transportFactory.getRegistry();
}
} catch (BusException e) {
// why are we throwing a busexception if the DF isn't found?
}
return null;
}
示例7: createEndpointInfo
import org.apache.cxf.transport.DestinationFactoryManager; //导入依赖的package包/类
protected EndpointInfo createEndpointInfo() throws BusException {
String transportId = getTransportId();
if (transportId == null && getAddress() != null) {
DestinationFactory df = getDestinationFactory();
if (df == null) {
DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class);
df = dfm.getDestinationFactoryForUri(getAddress());
}
if (df != null) {
transportId = df.getTransportIds().get(0);
}
}
// default to http transport
if (transportId == null) {
transportId = "http://schemas.xmlsoap.org/wsdl/soap/http";
}
setTransportId(transportId);
EndpointInfo ei = new EndpointInfo();
ei.setTransportId(transportId);
ei.setName(serviceFactory.getService().getName());
ei.setAddress(getAddress());
ei.setProperty(PROTOBUF_MESSAGE_CLASS, messageClass);
BindingInfo bindingInfo = createBindingInfo();
ei.setBinding(bindingInfo);
return ei;
}