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


Java SpringBusFactory.createBus方法代码示例

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


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

示例1: testSignature

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
@Test
public void testSignature() throws Exception {
    SpringBusFactory bf = new SpringBusFactory();
    URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");

    Bus bus = bf.createBus(busFile.toString());
    BusFactory.setDefaultBus(bus);
    BusFactory.setThreadDefaultBus(bus);
    
    GreeterService gs = new GreeterService();
    Greeter greeter = gs.getGreeterSignaturePort();
     
    ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            "http://localhost:" + CXFTestSupport.getPort2() 
            + "/WSSecurityRouteTest/GreeterSignaturePort"
    );
    
    assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java

示例2: testUsernameToken

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
@Test
public void testUsernameToken() throws Exception {
    SpringBusFactory bf = new SpringBusFactory();
    URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");

    Bus bus = bf.createBus(busFile.toString());
    BusFactory.setDefaultBus(bus);
    BusFactory.setThreadDefaultBus(bus);
    
    GreeterService gs = new GreeterService();
    Greeter greeter = gs.getGreeterUsernameTokenPort();
     
    ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            "http://localhost:" + CXFTestSupport.getPort2() 
            + "/WSSecurityRouteTest/GreeterUsernameTokenPort"
    );
    
    assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java

示例3: testEncryption

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
@Test
public void testEncryption() throws Exception {
    SpringBusFactory bf = new SpringBusFactory();
    URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");

    Bus bus = bf.createBus(busFile.toString());
    BusFactory.setDefaultBus(bus);
    BusFactory.setThreadDefaultBus(bus);
    
    GreeterService gs = new GreeterService();
    Greeter greeter = gs.getGreeterEncryptionPort();
     
    ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            "http://localhost:" + CXFTestSupport.getPort2() 
            + "/WSSecurityRouteTest/GreeterEncryptionPort"
    );
    
    assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java

示例4: testSecurityPolicy

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
@Test
public void testSecurityPolicy() throws Exception {
    SpringBusFactory bf = new SpringBusFactory();
    URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");

    Bus bus = bf.createBus(busFile.toString());
    BusFactory.setDefaultBus(bus);
    BusFactory.setThreadDefaultBus(bus);
    
    GreeterService gs = new GreeterService();
    Greeter greeter = gs.getGreeterSecurityPolicyPort();
     
    ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            "http://localhost:" + CXFTestSupport.getPort2() 
            + "/WSSecurityRouteTest/GreeterSecurityPolicyPort"
    );
    
    assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java

示例5: testCamelDestinationConfiguration

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
@Test
public void testCamelDestinationConfiguration() throws Exception {
    QName testEndpointQName = new QName("http://camel.apache.org/camel-test", "port");
    // set up the bus with configure file
    SpringBusFactory bf = new SpringBusFactory();
    BusFactory.setDefaultBus(null);
    Bus bus = bf.createBus("/org/apache/camel/component/cxf/transport/CamelDestination.xml");
    BusFactory.setDefaultBus(bus);

    endpointInfo.setAddress("camel://direct:EndpointA");
    endpointInfo.setName(testEndpointQName);
    CamelDestination destination = new CamelDestination(null, bus, null, endpointInfo);

    assertEquals("{http://camel.apache.org/camel-test}port.camel-destination", destination.getBeanName());
    CamelContext context = destination.getCamelContext();

    assertNotNull("The camel context which get from camel destination is not null", context);
    assertEquals("Get the wrong camel context", context.getName(), "dest_context");
    assertEquals("The camel context should has two routers", context.getRoutes().size(), 2);
    bus.shutdown(false);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:22,代码来源:CamelDestinationTest.java

示例6: createSoapClient

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
public static DelegatedCredentialPortType createSoapClient(
        String url, KeyStoreType truststore, KeyManagersType keyManager)
        throws GeneralSecurityException, IOException {

    SpringBusFactory bf = new SpringBusFactory();
    Bus bus = bf.createBus();
    Configurer baseConf = bus.getExtension(Configurer.class);
    SSLConfigurer sslConf = new SSLConfigurer(baseConf);
    sslConf.setTruststore(truststore);
    sslConf.setKeystore(keyManager);
    bus.setExtension(sslConf, Configurer.class);

    JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
    cf.setAddress(url);
    cf.setServiceClass(DelegatedCredentialService.class);
    cf.setBus(bus);
    DelegatedCredentialPortType cdsPort = cf.create(DelegatedCredentialPortType.class);
    return cdsPort;

}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:21,代码来源:DCSSoapClientFactory.java

示例7: createSoapClient

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
public static CredentialDelegationServicePortType createSoapClient(
        String url, KeyStoreType truststore, KeyManagersType keyManager)
        throws GeneralSecurityException, IOException {
    SpringBusFactory bf = new SpringBusFactory();
    Bus bus = bf.createBus();
    Configurer baseConf = bus.getExtension(Configurer.class);
    SSLConfigurer sslConf = new SSLConfigurer(baseConf);
    sslConf.setTruststore(truststore);
    sslConf.setKeystore(keyManager);
    bus.setExtension(sslConf, Configurer.class);

    JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
    cf.setAddress(url);
    cf.setServiceClass(CredentialDelegationService.class);
    cf.setBus(bus);
    CredentialDelegationServicePortType cdsPort = cf.create(CredentialDelegationServicePortType.class);
    return cdsPort;
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:19,代码来源:CDSSoapClientFactory.java

示例8: createSoapClient

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
public static GlobalModelExchangePortType createSoapClient(String url, KeyStoreType truststore, KeyManagersType keyManager) throws GeneralSecurityException, IOException {
    SpringBusFactory bf = new SpringBusFactory();
    Bus bus = bf.createBus();
    Configurer baseConf = bus.getExtension(Configurer.class);
    org.cagrid.core.common.security.SSLConfigurer sslConf = new org.cagrid.core.common.security.SSLConfigurer(baseConf);
    sslConf.setTruststore(truststore);
    sslConf.setKeystore(keyManager);
    bus.setExtension(sslConf, Configurer.class);

    JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
    cf.setAddress(url);
    cf.setServiceClass(GlobalModelExchangeService.class);
    cf.setBus(bus);
    GlobalModelExchangePortType gmePort = cf.create(GlobalModelExchangePortType.class);
    return gmePort;
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:17,代码来源:GMESoapClientFactory.java

示例9: createSoapClient

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
public static GridGrouperPortType createSoapClient(String url,
                                                   KeyStoreType truststore, KeyManagersType keyManager)
        throws GeneralSecurityException, IOException {
    SpringBusFactory bf = new SpringBusFactory();
    Bus bus = bf.createBus();
    Configurer baseConf = bus.getExtension(Configurer.class);
    org.cagrid.core.common.security.SSLConfigurer sslConf = new org.cagrid.core.common.security.SSLConfigurer(baseConf);
    sslConf.setTruststore(truststore);
    sslConf.setKeystore(keyManager);
    bus.setExtension(sslConf, Configurer.class);

    JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
    cf.setAddress(url);
    cf.setServiceClass(GridGrouperService.class);
    cf.setBus(bus);
    GridGrouperPortType gridGrouperPort = cf.create(GridGrouperPortType.class);
    return gridGrouperPort;
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:19,代码来源:GridGrouperSoapClientFactory.java

示例10: createSoapClient

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
public static GTSPortType createSoapClient(String url,
                                           KeyStoreType truststore, KeyManagersType keyManager)
        throws GeneralSecurityException, IOException {

    SpringBusFactory bf = new SpringBusFactory();
    Bus bus = bf.createBus();
    Configurer baseConf = bus.getExtension(Configurer.class);
    SSLConfigurer sslConf = new SSLConfigurer(baseConf);
    sslConf.setTruststore(truststore);
    sslConf.setKeystore(keyManager);
    bus.setExtension(sslConf, Configurer.class);

    JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
    cf.setAddress(url);
    cf.setServiceClass(GTSService.class);
    cf.setBus(bus);
    GTSPortType gtsPort = cf.create(GTSPortType.class);
    return gtsPort;
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:20,代码来源:GTSSoapClientFactory.java

示例11: createSoapClient

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
public static DorianPortType createSoapClient(String url,
                                              KeyStoreType truststore, KeyManagersType keyManager)
        throws GeneralSecurityException, IOException {
    SpringBusFactory bf = new SpringBusFactory();
    Bus bus = bf.createBus();
    Configurer baseConf = bus.getExtension(Configurer.class);
    SSLConfigurer sslConf = new SSLConfigurer(baseConf);
    sslConf.setTruststore(truststore);
    sslConf.setKeystore(keyManager);
    bus.setExtension(sslConf, Configurer.class);

    JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
    cf.setAddress(url);
    cf.setServiceClass(DorianService.class);
    cf.setBus(bus);
    DorianPortType dorianPort = cf.create(DorianPortType.class);
    return dorianPort;
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:19,代码来源:DorianSoapClientFactory.java

示例12: givenFakeSOAPWebserviceThroughHttps

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
@Given("send SOAP web service through https")
public void givenFakeSOAPWebserviceThroughHttps() {
    SpringBusFactory factory = new SpringBusFactory();
    Bus bus = factory.createBus("src/test/resources/META-INF/spring/jaxws-server-with-ssl.xml");
    BusFactory.setDefaultBus(bus);
    Endpoint endpoint = Endpoint.publish("https://localhost:9091/WheatherServicePort", new WheatherServiceImpl());
    assertTrue(endpoint.isPublished());
    Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", endpoint.getBinding().getBindingID());
}
 
开发者ID:tapack,项目名称:satisfy,代码行数:10,代码来源:FakeSoapServiceSteps.java

示例13: getBean

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
static JAXRSClientFactoryBean getBean(String baseAddress, String configLocation, Map<String, String> headers) {
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    if (configLocation != null) {
        SpringBusFactory bf = new SpringBusFactory();
        Bus bus = bf.createBus(configLocation);
        bean.setBus(bus);
    }
    bean.setAddress(baseAddress);
    if (headers != null && !headers.isEmpty()) {
        bean.setHeaders(headers);
    }
    return bean;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:IdentityManagementEndpointUtil.java

示例14: cxf

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
@Bean(destroyMethod = "shutdown")
public Bus cxf() {
	
	SpringBusFactory factory = new SpringBusFactory();
	springBus = factory.createBus();
    BusFactory.setDefaultBus( springBus );
    
    return springBus;
	
	//System.out.println( "CxfTestConfig: cxf bean" );
    //return new SpringBus();
}
 
开发者ID:amoldavsky,项目名称:restful-api-cxf-spring-java,代码行数:13,代码来源:CxfTestConfig.java

示例15: prepare

import org.apache.cxf.bus.spring.SpringBusFactory; //导入方法依赖的package包/类
public void prepare() throws Exception {
    // Set a system property used to configure the server.  The examples all run on port 9091; 
    // however, the unit tests must run on a dynamic port.  As such, we make the port configurable
    // in the Spring context.
    System.setProperty("port", "9001");
    // setup the Camel context for the Camel transport
    // START SNIPPET: e1
    SpringBusFactory bf = new SpringBusFactory();
    BusFactory.setDefaultBus(null);
    Bus bus = bf.createBus("/org/apache/camel/example/camel/transport/CamelDestination.xml");
    BusFactory.setDefaultBus(bus);
    // END SNIPPET: e1
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:Server.java


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