当前位置: 首页>>代码示例>>Java>>正文


Java CXFNonSpringServlet类代码示例

本文整理汇总了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();
}
 
开发者ID:csierra,项目名称:osgi-jaxrs-extracted,代码行数:42,代码来源:ServicesRegistrator.java

示例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;
}
 
开发者ID:apache,项目名称:aries-jax-rs-whiteboard,代码行数:6,代码来源:Whiteboard.java

示例3: buildServlet

import org.apache.cxf.transport.servlet.CXFNonSpringServlet; //导入依赖的package包/类
public HttpServlet buildServlet() {
    CXFNonSpringServlet cxf = new CXFNonSpringServlet();
    cxf.setBus(bus);
    return cxf;
}
 
开发者ID:roskart,项目名称:dropwizard-jaxws,代码行数:6,代码来源:JAXWSEnvironment.java

示例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)));
}
 
开发者ID:roskart,项目名称:dropwizard-jaxws,代码行数:7,代码来源:JAXWSEnvironmentTest.java

示例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));

}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:20,代码来源:JAXWSExporterWithHttpServiceTest.java

示例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);
    }
 
开发者ID:kantega,项目名称:respiro,代码行数:29,代码来源:CxfPlugin.java


注:本文中的org.apache.cxf.transport.servlet.CXFNonSpringServlet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。