本文整理汇总了Java中org.apache.cxf.transport.servlet.CXFNonSpringServlet类的典型用法代码示例。如果您正苦于以下问题:Java CXFNonSpringServlet类的具体用法?Java CXFNonSpringServlet怎么用?Java CXFNonSpringServlet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CXFNonSpringServlet类属于org.apache.cxf.transport.servlet包,在下文中一共展示了CXFNonSpringServlet类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addingService
import org.apache.cxf.transport.servlet.CXFNonSpringServlet; //导入依赖的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();
}
示例2: createCXFServlet
import org.apache.cxf.transport.servlet.CXFNonSpringServlet; //导入依赖的package包/类
private static CXFNonSpringServlet createCXFServlet(Bus bus) {
CXFNonSpringServlet cxfNonSpringServlet = new CXFNonSpringServlet();
cxfNonSpringServlet.setBus(bus);
return cxfNonSpringServlet;
}
示例3: buildServlet
import org.apache.cxf.transport.servlet.CXFNonSpringServlet; //导入依赖的package包/类
public HttpServlet buildServlet() {
CXFNonSpringServlet cxf = new CXFNonSpringServlet();
cxf.setBus(bus);
return cxf;
}
示例4: buildServlet
import org.apache.cxf.transport.servlet.CXFNonSpringServlet; //导入依赖的package包/类
@Test
public void buildServlet() {
Object result = jaxwsEnvironment.buildServlet();
assertThat(result, is(instanceOf(CXFNonSpringServlet.class)));
assertThat(((CXFNonSpringServlet) result).getBus(), is(instanceOf(Bus.class)));
}
示例5: worksInCaseHttpServiceWasInjected
import org.apache.cxf.transport.servlet.CXFNonSpringServlet; //导入依赖的package包/类
@Test
public void worksInCaseHttpServiceWasInjected() throws BinderException, ServletException, NamespaceException {
Map<String, Object> metadata = new HashMap<String, Object>();
metadata.put(ID, "TestJAXWSDeclaration");
metadata.put("fuchsia.export.cxf.class.name", ServiceForExportation.class.getName());
metadata.put("fuchsia.export.cxf.url.context", "/" + ServiceForExportation.class.getSimpleName());
ExportDeclaration declaration = spy(ExportDeclarationBuilder.fromMetadata(metadata).build());
declaration.bind(serviceReferenceFromExporter);
exporter.registration(serviceReferenceFromExporter);
exporter.addDeclaration(declaration);
verify(httpServiceMock, times(1)).registerServlet(eq(org.ow2.chameleon.fuchsia.exporter.jaxws.internal.Constants.CXF_SERVLET), any(CXFNonSpringServlet.class), any(Dictionary.class), any(org.osgi.service.http.HttpContext.class));
}
示例6: CxfPlugin
import org.apache.cxf.transport.servlet.CXFNonSpringServlet; //导入依赖的package包/类
public CxfPlugin(@Config(defaultValue = "/ws/*", doc = "Path where the CXF plugin will be deployed") String mountPoint,
@Config(defaultValue = "BOTH") String schemaValidation,
Collection<EndpointCustomizer> endpointCustomizers,
Collection<ServiceCustomizer> serviceCustomizers,
ServletBuilder servletBuilder) throws ServletException {
this.schemaValidation = schemaValidation;
this.endpointCustomizers = endpointCustomizers;
Bus bus = BusFactory.newInstance().createBus();
ServiceContractResolverRegistry reg = new ServiceContractResolverRegistryImpl(bus);
reg.register(new RespiroServiceContractResolver());
CXFNonSpringServlet cxfNonSpringServlet = new CXFNonSpringServlet();
cxfNonSpringServlet.setBus(bus);
cxfNonSpringServlet.init(servletBuilder.servletConfig("cxf", new Properties()));
cxfFilter = servletBuilder.servlet(cxfNonSpringServlet, mountPoint);
endpointBuilder = new DefaultEndpointBuilder();
serviceBuilder = new DefaultServiceBuilder(serviceCustomizers);
endpointDeployer = endpointConfigs -> CxfPlugin.this.deployEndpoints(endpointConfigs);
}