Search in sources :

Example 11 with BusFactory

use of org.apache.cxf.BusFactory in project camel by apache.

the class CxfEndpointUtils method createBus.

/**
     * Create a CXF bus with either BusFactory or SpringBusFactory if Camel Context
     * is SpringCamelContext.  In the latter case, this method updates the bus 
     * configuration with the applicationContext which SpringCamelContext holds 
     * 
     * @param context - the Camel Context
     */
public static Bus createBus(CamelContext context) {
    BusFactory busFactory = BusFactory.newInstance();
    if (context instanceof SpringCamelContext) {
        SpringCamelContext springCamelContext = (SpringCamelContext) context;
        ApplicationContext applicationContext = springCamelContext.getApplicationContext();
        busFactory = new SpringBusFactory(applicationContext);
    }
    return busFactory.createBus();
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) SpringCamelContext(org.apache.camel.spring.SpringCamelContext) BusFactory(org.apache.cxf.BusFactory) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory)

Example 12 with BusFactory

use of org.apache.cxf.BusFactory in project ddf by codice.

the class AbstractStsRealm method getBus.

/**
     * Helper method to setup STS Client.
     */
protected Bus getBus() {
    BusFactory bf = new CXFBusFactory();
    Bus setBus = bf.createBus();
    SpringBusFactory.setDefaultBus(setBus);
    SpringBusFactory.setThreadDefaultBus(setBus);
    return setBus;
}
Also used : Bus(org.apache.cxf.Bus) CXFBusFactory(org.apache.cxf.bus.CXFBusFactory) BusFactory(org.apache.cxf.BusFactory) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) CXFBusFactory(org.apache.cxf.bus.CXFBusFactory)

Example 13 with BusFactory

use of org.apache.cxf.BusFactory in project cxf by apache.

the class UndertowBasicAuthTest method testGetWSDL.

@org.junit.Test
public void testGetWSDL() throws Exception {
    BusFactory bf = BusFactory.newInstance();
    Bus bus = bf.createBus();
    bus.getInInterceptors().add(new LoggingInInterceptor());
    bus.getOutInterceptors().add(new LoggingOutInterceptor());
    MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer();
    bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class);
    JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus);
    factory.createClient(ADDRESS + "?wsdl");
}
Also used : JaxWsDynamicClientFactory(org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory) Bus(org.apache.cxf.Bus) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) LoggingInInterceptor(org.apache.cxf.ext.logging.LoggingInInterceptor) BusFactory(org.apache.cxf.BusFactory)

Example 14 with BusFactory

use of org.apache.cxf.BusFactory in project cxf by apache.

the class UndertowDigestAuthTest method testGetWSDL.

@Test
public void testGetWSDL() throws Exception {
    BusFactory bf = BusFactory.newInstance();
    Bus bus = bf.createBus();
    bus.getInInterceptors().add(new LoggingInInterceptor());
    bus.getOutInterceptors().add(new LoggingOutInterceptor());
    MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer();
    bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class);
    JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus);
    factory.createClient(ADDRESS + "?wsdl");
}
Also used : JaxWsDynamicClientFactory(org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory) Bus(org.apache.cxf.Bus) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) LoggingInInterceptor(org.apache.cxf.ext.logging.LoggingInInterceptor) BusFactory(org.apache.cxf.BusFactory) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) Test(org.junit.Test)

Example 15 with BusFactory

use of org.apache.cxf.BusFactory in project cxf by apache.

the class BusExtensionLoadingTest method testDefaultBusConstruction.

/**
 * Test for checking the ExtensionManagerBus is built using the TCCL by default
 *
 * @throws Exception
 */
@Test
public void testDefaultBusConstruction() throws Exception {
    BusFactory factory = new CXFBusFactory();
    Bus bus = factory.createBus();
    assertNotNullExtensions(bus);
    bus.shutdown(true);
}
Also used : Bus(org.apache.cxf.Bus) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) CXFBusFactory(org.apache.cxf.bus.CXFBusFactory) BusFactory(org.apache.cxf.BusFactory) CXFBusFactory(org.apache.cxf.bus.CXFBusFactory) Test(org.junit.Test)

Aggregations

BusFactory (org.apache.cxf.BusFactory)20 Bus (org.apache.cxf.Bus)14 Test (org.junit.Test)5 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)4 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)4 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)4 JaxWsDynamicClientFactory (org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory)4 CXFBusFactory (org.apache.cxf.bus.CXFBusFactory)3 JBossWSBusFactory (org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory)3 Subject (javax.security.auth.Subject)2 ExtensionManagerBus (org.apache.cxf.bus.extension.ExtensionManagerBus)2 Before (org.junit.Before)2 IOException (java.io.IOException)1 URL (java.net.URL)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 ResourceException (javax.resource.ResourceException)1 ManagedConnection (javax.resource.spi.ManagedConnection)1 QName (javax.xml.namespace.QName)1 PooledConnectionFactory (org.apache.activemq.pool.PooledConnectionFactory)1