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


Java ServerFactoryBean.create方法代码示例

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


在下文中一共展示了ServerFactoryBean.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setUp

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
    deleteDirectory("target/filetocxf");

    // set CXF
    ServerFactoryBean factory = new ServerFactoryBean();

    factory.setAddress("http://localhost:" + port1 + "/FileToCxfMessageDataFormatTest/router");
    factory.setServiceClass(HelloService.class);
    factory.setServiceBean(new HelloServiceImpl());

    server = factory.create();
    server.start();

    super.setUp();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:FileToCxfMessageDataFormatTest.java

示例4: 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

示例5: createLocalService

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
/**
 * 构造服务,注意要自己释放
 * @param intf
 * @param bean
 * @return
 */
private Server createLocalService(Class<?> intf, Object bean) {
	String url = "local://" + intf.getName();
	ServiceDefinition ws = getFactory().processServiceDef(new ServiceDefinition(intf.getSimpleName(), intf, bean));
	if (ws == null)
		return null;
	ServerFactoryBean sf = new ServerFactoryBean(new CXFPlusServiceBean());
	sf.setAddress(url);
	sf.setServiceBean(ws.getServiceBean());
	sf.setServiceClass(ws.getServiceClass());
	if (printTrace()){
		sf.getInInterceptors().add(new LoggingInInterceptor());
		sf.getOutInterceptors().add(new LoggingOutInterceptor());
	}
	Server server = sf.create();
	return server;
}
 
开发者ID:GeeQuery,项目名称:cxf-plus,代码行数:23,代码来源:CXFTestBase.java

示例6: 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

示例7: 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

示例8: CxfConsumer

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
public CxfConsumer(final CxfEndpoint endpoint, Processor processor) throws Exception {
    super(endpoint, processor);
    cxfEndpoint = endpoint;
    // create server
    ServerFactoryBean svrBean = endpoint.createServerFactoryBean();
    svrBean.setInvoker(new CxfConsumerInvoker(endpoint));
    server = svrBean.create();
    // Apply the server configurer if it is possible 
    if (cxfEndpoint.getCxfEndpointConfigurer() != null) {
        cxfEndpoint.getCxfEndpointConfigurer().configureServer(server);
    }
    if (ObjectHelper.isNotEmpty(endpoint.getPublishedEndpointUrl())) {
        server.getEndpoint().getEndpointInfo().setProperty("publishedEndpointUrl", endpoint.getPublishedEndpointUrl());
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:CxfConsumer.java

示例9: startService

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@BeforeClass
public static void startService() {
    //start a service
    ServerFactoryBean svrBean = new ServerFactoryBean();

    svrBean.setAddress(SERVICE_ADDRESS);
    svrBean.setServiceClass(HelloService.class);
    svrBean.setServiceBean(new HelloServiceImpl());

    server = svrBean.create();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:12,代码来源:LoggingInterceptorInMessageModeTest.java

示例10: startService

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@Before
public void startService() {       
    //start a service
    ServerFactoryBean svrBean = new ServerFactoryBean();

    svrBean.setAddress(getServiceAddress());
    svrBean.setServiceClass(HelloService.class);
    svrBean.setServiceBean(new HelloServiceImpl());
    configureFactory(svrBean);
    server = svrBean.create();
    server.start();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:CxfSimpleRouterTest.java

示例11: 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

示例12: init

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@BeforeClass
public static void init() {

    // publish a web-service
    ServerFactoryBean factory = new ServerFactoryBean();
    factory.setAddress(SERVICE_ADDRESS);
    factory.setServiceBean(new HelloServiceImpl());
    factory.create();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:10,代码来源:FailOverFeatureTest.java

示例13: 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

示例14: startService

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@BeforeClass
public static void startService() {       
    //start a service
    ServerFactoryBean svrBean = new ServerFactoryBean();

    svrBean.setAddress(SERVICE_ADDRESS);
    svrBean.setServiceClass(HelloService.class);
    svrBean.setServiceBean(new HelloServiceImpl());
    svrBean.setBindingId(getBindingId());

    Server server = svrBean.create();
    server.start();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:CxfPayLoadMessageXmlBindingRouterTest.java

示例15: init

import org.apache.cxf.frontend.ServerFactoryBean; //导入方法依赖的package包/类
@BeforeClass
public static void init() {

    // publish two web-service
    ServerFactoryBean factory1 = new ServerFactoryBean();
    factory1.setAddress(SERVICE_ADDRESS_1);
    factory1.setServiceBean(new HelloServiceImpl(" Server1"));
    factory1.create();
    
    ServerFactoryBean factory2 = new ServerFactoryBean();
    factory2.setAddress(SERVICE_ADDRESS_2);
    factory2.setServiceBean(new HelloServiceImpl(" Server2"));
    factory2.create();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:LoadDistributorFeatureTest.java


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