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


Java ServerFactoryBean.setBus方法代码示例

本文整理汇总了Java中org.apache.cxf.frontend.ServerFactoryBean.setBus方法的典型用法代码示例。如果您正苦于以下问题:Java ServerFactoryBean.setBus方法的具体用法?Java ServerFactoryBean.setBus怎么用?Java ServerFactoryBean.setBus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cxf.frontend.ServerFactoryBean的用法示例。


在下文中一共展示了ServerFactoryBean.setBus方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doExport

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
protected <T> Runnable doExport(T impl, Class<T> type, URL url) throws RpcException {
	String addr = url.getIp() + ":" + url.getPort();
    HttpServer httpServer = serverMap.get(addr);
    if (httpServer == null) {
        httpServer = httpBinder.bind(url, new WebServiceHandler());
        serverMap.put(addr, httpServer);
    }
    final ServerFactoryBean serverFactoryBean = new ServerFactoryBean();
    serverFactoryBean.setAddress(url.getAbsolutePath());
	serverFactoryBean.setServiceClass(type);
	serverFactoryBean.setServiceBean(impl);
	serverFactoryBean.setBus(bus);
    serverFactoryBean.setDestinationFactory(transportFactory);
	serverFactoryBean.create();
    return new Runnable() {
        public void run() {
        	serverFactoryBean.destroy();
        }
    };
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:21,代码来源:WebServiceProtocol.java

示例2: doExport

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
protected <T> Runnable doExport(T impl, Class<T> type, URL url) throws JahhanException {
	String addr = url.getIp() + ":" + url.getPort();
    HttpServer httpServer = serverMap.get(addr);
    if (httpServer == null) {
        httpServer = httpBinder.bind(url, new WebServiceHandler());
        serverMap.put(addr, httpServer);
    }
    final ServerFactoryBean serverFactoryBean = new ServerFactoryBean();
    serverFactoryBean.setAddress(url.getAbsolutePath());
	serverFactoryBean.setServiceClass(type);
	serverFactoryBean.setServiceBean(impl);
	serverFactoryBean.setBus(bus);
    serverFactoryBean.setDestinationFactory(transportFactory);
	serverFactoryBean.create();
    return new Runnable() {
        public void run() {
        	serverFactoryBean.destroy();
        }
    };
}
 
开发者ID:nince-wyj,项目名称:jahhan,代码行数:21,代码来源:WebServiceProtocol.java

示例3: loadBus

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@Override
public void loadBus(ServletConfig servletConfig) throws ServletException {
    super.loadBus(servletConfig);
    
    // TODO: Hacky first version to get default Process Engine
    ProcessEngine processEngine = ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResourceDefault()
      .buildProcessEngine();
    
    Bus bus = getBus();
    BusFactory.setDefaultBus(bus); 
    Endpoint.publish("/RuntimeService", new RuntimeWebServiceImpl(processEngine));
    
    // You can als use the simple frontend API to do this
    ServerFactoryBean factory = new ServerFactoryBean();
    factory.setBus(bus);
    factory.setServiceClass(RuntimeWebServiceImpl.class);
    factory.setAddress("/RuntimeService");
    factory.create();              
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:21,代码来源:WebServiceProviderServlet.java

示例4: addService

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
/**
* Creates a webservice endpoint for an interface/implementation pair based on their fullnames<p>
* Classes and Interfaces to be used as webservice should be made available in the pom.xml
* 
* @param	serviceInterface  		The interface fullname of the webservice to be added
* @param	serviceImplementation	The implementation class fullname of the webservice to be added
* @throws Exception 
* @see		WebServiceServlet, ServerFactoryBean
*/
  public void addService(String serviceInterface, String serviceImplementation) throws Exception
  {
  	String serviceName = extractServiceName(serviceInterface);
      ServerFactoryBean svrFactory = new ServerFactoryBean();
  	try {
  		if(bus != null) {
  			svrFactory.setBus(bus);
  		}
	svrFactory.setServiceClass(Class.forName(serviceInterface));
	svrFactory.setAddress(baseAddress + serviceName);
	svrFactory.setServiceBean(Class.forName(serviceImplementation).newInstance());
       svrFactory.getServiceFactory().setDataBinding(new AegisDatabinding());
       svrFactory.create();
       System.out.println(svrFactory.getServiceFactory().getEndpointInfo().getAddress());

} catch (Exception e) {
	logger.error("Error adding webservices with interface : " + serviceInterface  + " and implementation : " + serviceImplementation, e);
	throw e;
} 
  }
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:30,代码来源:GenericWebServiceServer.java

示例5: doExport

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
protected <T> Runnable doExport(T impl, Class<T> type, URL url) throws RpcException {
    String addr = getAddr(url);
    HttpServer httpServer = serverMap.get(addr);
    if (httpServer == null) {
        httpServer = httpBinder.bind(url, new WebServiceHandler());
        serverMap.put(addr, httpServer);
    }
    final ServerFactoryBean serverFactoryBean = new ServerFactoryBean();
    serverFactoryBean.setAddress(url.getAbsolutePath());
    serverFactoryBean.setServiceClass(type);
    serverFactoryBean.setServiceBean(impl);
    serverFactoryBean.setBus(bus);
    serverFactoryBean.setDestinationFactory(transportFactory);
    serverFactoryBean.create();
    return new Runnable() {
        public void run() {
            serverFactoryBean.destroy();
        }
    };
}
 
开发者ID:hufeng,项目名称:dubbo2.js,代码行数:21,代码来源:WebServiceProtocol.java

示例6: startService

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@Before
public void startService() throws Exception {
    // start a simple front service
    ServerFactoryBean svrBean = new ServerFactoryBean();
    svrBean.setAddress(getSimpleServerAddress());
    svrBean.setServiceClass(HelloService.class);
    svrBean.setServiceBean(new HelloServiceImpl());
    svrBean.setBus(BusFactory.getDefaultBus());
    server = svrBean.create();
    
    GreeterImpl greeterImpl = new GreeterImpl();
    endpoint = Endpoint.publish(getJaxWsServerAddress(), greeterImpl);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:CxfProducerTest.java

示例7: startServer

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@BeforeClass
public static void startServer() throws Exception {        
    // start a simple front service
    ServerFactoryBean svrBean = new ServerFactoryBean();
    svrBean.setAddress(SIMPLE_SERVER_ADDRESS);
    svrBean.setServiceClass(HelloService.class);
    svrBean.setServiceBean(new HelloServiceImpl());
    svrBean.setBus(BusFactory.getDefaultBus());
    svrBean.create();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:CxfProducerSynchronousFalseTest.java

示例8: useExportDeclaration

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@Override
public void useExportDeclaration(ExportDeclaration exportDeclaration) throws BinderException {

    LOG.info("exporting {}", exportDeclaration.getMetadata());

    JAXWSExportDeclarationWrapper pojo = JAXWSExportDeclarationWrapper.create(exportDeclaration);

    try {

        ServerFactoryBean srvFactory = new ServerFactoryBean();

        Class ref = FuchsiaUtils.loadClass(this.context, pojo.getClazz());

        srvFactory.setServiceClass(ref);

        srvFactory.setBus(cxfbus);

        ServiceReference[] jaxWsReferences = context.getAllServiceReferences(pojo.getClazz(), pojo.getFilter());

        if (jaxWsReferences == null) {
            LOG.warn("instance not found to be exported, ignoring exportation request, filter:" + pojo.getFilter());
            return;
        }

        Object object = context.getService(jaxWsReferences[0]);

        srvFactory.setServiceBean(object);

        srvFactory.setAddress(pojo.getWebcontext());

        org.apache.cxf.endpoint.Server endpoint = srvFactory.create();

        exportDeclaration.handle(serviceReference);

        exportedDeclaration.put(pojo.getWebcontext(), endpoint);

        srvFactory.getServer().start();

        LOG.info("Pushing CXF endpoint: {}", endpoint.getEndpoint().getEndpointInfo().getAddress());

    } catch (Exception e) {
        LOG.error("Failed exporting in CXF", e);
        throw new BinderException(e);
    }
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:46,代码来源:JAXWSExporter.java


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