本文整理汇总了Java中org.apache.cxf.bus.CXFBusFactory类的典型用法代码示例。如果您正苦于以下问题:Java CXFBusFactory类的具体用法?Java CXFBusFactory怎么用?Java CXFBusFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CXFBusFactory类属于org.apache.cxf.bus包,在下文中一共展示了CXFBusFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
@Before
public void setup() {
final Bus bus = CXFBusFactory.getThreadDefaultBus();
JaxWsServerFactoryBean jaxWsServer = createJaxWsServer();
jaxWsServer.getFeatures().add(new LoggingFeature());
jaxWsServer.getFeatures().add(new TraceeCxfFeature(serverBackend, Profile.DEFAULT));
server = jaxWsServer.create();
JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
factoryBean.setServiceClass(HelloWorldTestService.class);
factoryBean.setAddress(endpointAddress);
factoryBean.getHandlers().add(new TraceeClientHandler(clientBackend));
factoryBean.setBus(bus);
helloWorldPort = factoryBean.create(HelloWorldTestService.class);
}
示例2: setup
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
@Before
public void setup() {
JaxWsServerFactoryBean jaxWsServer = createJaxWsServer();
jaxWsServer.getHandlers().add(new TraceeServerHandler(serverBackend, new SoapHeaderTransport()));
server = jaxWsServer.create();
JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
factoryBean.setServiceClass(HelloWorldTestService.class);
factoryBean.setAddress(endpointAddress);
factoryBean.getHandlers().add(new TraceeClientHandler(clientBackend));
factoryBean.setBus(CXFBusFactory.getDefaultBus());
helloWorldPort = factoryBean.create(HelloWorldTestService.class);
}
示例3: setUpBus
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
private void setUpBus() {
Bus bus = CXFBusFactory.getDefaultBus();
ClientOnlyHTTPTransportFactory httpTransport = new ClientOnlyHTTPTransportFactory();
// httpTransport = new ServletTransportFactory();
httpTransport.setBus(bus);
List<String> transportIds = Arrays.asList(new String[] {
"http://schemas.xmlsoap.org/wsdl/soap/http", "http://schemas.xmlsoap.org/soap/http",
"http://www.w3.org/2003/05/soap/bindings/HTTP/", "http://schemas.xmlsoap.org/wsdl/http/",
"http://cxf.apache.org/transports/http/configuration", "http://cxf.apache.org/bindings/xformat", });
httpTransport.setTransportIds(transportIds);
httpTransport.registerWithBindingManager();
// httpTransport.register();
}
示例4: createJaxWsServer
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
protected JaxWsServerFactoryBean createJaxWsServer() {
JaxWsServerFactoryBean serverFactoryBean = new JaxWsServerFactoryBean();
serverFactoryBean.setServiceClass(HelloWorldTestServiceImpl.class);
serverFactoryBean.setAddress(endpointAddress);
serverFactoryBean.setServiceBean(new HelloWorldTestServiceImpl(serverBackend));
serverFactoryBean.setBus(CXFBusFactory.getDefaultBus());
return serverFactoryBean;
}
示例5: setup
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
@Before
public void setup() {
JaxWsServerFactoryBean jaxWsServer = createJaxWsServer();
jaxWsServer.getFeatures().add(new LoggingFeature());
jaxWsServer.getFeatures().add(new TraceeCxfFeature(serverBackend, Profile.DEFAULT));
server = jaxWsServer.create();
final ClientProxyFactoryBean factoryBean = new ClientProxyFactoryBean();
factoryBean.getFeatures().add(new LoggingFeature());
factoryBean.getFeatures().add(new TraceeCxfFeature(clientBackend, Profile.DEFAULT));
factoryBean.setServiceClass(HelloWorldTestService.class);
factoryBean.setBus(CXFBusFactory.getDefaultBus());
factoryBean.setAddress(endpointAddress);
helloWorldPort = (HelloWorldTestService) factoryBean.create();
}
示例6: initDefaultBus
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
private static Bus initDefaultBus() {
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(CxfUtil.class.getClassLoader());
try { // create the bus reusing cxf logic but skipping factory lookup
final Bus bus = BusFactory.newInstance(CXFBusFactory.class.getName()).createBus();
bus.setId(SystemInstance.get().getProperty("openejb.cxf.bus.id", "openejb.cxf.bus"));
final BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
bindingFactoryMap = (Map<String, BindingFactory>) Reflections.get(bfm, "bindingFactories");
bus.setExtension(new OpenEJBHttpDestinationFactory(), HttpDestinationFactory.class);
// ensure client proxies can use app classes
CXFBusFactory.setDefaultBus(Bus.class.cast(Proxy.newProxyInstance(CxfUtil.class.getClassLoader(), new Class<?>[]{Bus.class}, new ClientAwareBusHandler())));
bus.setProperty(ClassUnwrapper.class.getName(), new ClassUnwrapper() {
@Override
public Class<?> getRealClass(final Object o) {
final Class<?> aClass = o.getClass();
Class<?> c = aClass;
while (c.getName().contains("$$")) {
c = c.getSuperclass();
}
return c == Object.class ? aClass : c;
}
});
SystemInstance.get().addObserver(new LifecycleManager());
initAuthenticators();
return bus; // we keep as internal the real bus and just expose to cxf the client aware bus to be able to cast it easily
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
示例7: addingService
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
@Override
public Object addingService(
ServiceReference<ServletContextHelper> reference) {
String contextPath = (String)reference.getProperty(
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH);
CXFNonSpringServlet cxfNonSpringServlet = new CXFNonSpringServlet();
CXFBusFactory cxfBusFactory =
(CXFBusFactory) CXFBusFactory.newInstance(
CXFBusFactory.class.getName());
Bus bus = cxfBusFactory.createBus();
Dictionary<String, Object> properties = new Hashtable<>();
properties.put(
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT,
"(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=" +
HttpWhiteboardConstants.HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME + ")");
properties.put(
HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/*");
properties.put(Constants.SERVICE_RANKING, -1);
cxfNonSpringServlet.setBus(bus);
_servletServiceRegistration = _bundleContext.registerService(
Servlet.class, cxfNonSpringServlet, properties);
properties = new Hashtable<>();
properties.put(
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH,
contextPath);
_busServiceRegistration = _bundleContext.registerService(
Bus.class, bus, properties);
return new Object();
}
示例8: newInstance
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
public static DynamicClient newInstance() {
Bus bus = CXFBusFactory.getThreadDefaultBus();
return new DynamicClient(bus);
}
示例9: newInstance
import org.apache.cxf.bus.CXFBusFactory; //导入依赖的package包/类
/**
* Create a new instance using a default <tt>Bus</tt>.
*
* @return the new instance
* @see CXFBusFactory#getDefaultBus()
*/
public static CxfplusDynamicClientFactory newInstance() {
Bus bus = CXFBusFactory.getThreadDefaultBus();
return new CxfplusDynamicClientFactory(bus);
}