Search in sources :

Example 1 with BusHolder

use of org.jboss.wsf.stack.cxf.configuration.BusHolder in project jbossws-cxf by jbossws.

the class BusHolderLifeCycleTestCase method testBusShutdown.

@Test
public void testBusShutdown() {
    simpleShutdownTest(new BusHolder(new DDBeans()));
    shutdownTestWithInnerShutdown(new BusHolder(new DDBeans()));
    shutdownTestWithNoShutdown(new BusHolder(new DDBeans()));
}
Also used : DDBeans(org.jboss.wsf.stack.cxf.metadata.services.DDBeans) BusHolder(org.jboss.wsf.stack.cxf.configuration.BusHolder) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Example 2 with BusHolder

use of org.jboss.wsf.stack.cxf.configuration.BusHolder in project jbossws-cxf by jbossws.

the class CXFServletExt method updateAvailableBusWithServletInfo.

private void updateAvailableBusWithServletInfo(ServletConfig servletConfig) {
    BusHolder holder = endpoint.getService().getDeployment().getAttachment(BusHolder.class);
    // set the bus from deployment into the CXF servlet and assign it to the current thread (do not touch the default bus!)
    bus = holder.getBus();
    BusFactory.setThreadDefaultBus(bus);
    // update the resource manager adding the ServletContextResourceResolver that was to be added by CXF servlet
    ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
    resourceManager.addResourceResolver(new ServletContextResourceResolver(servletConfig.getServletContext()));
}
Also used : ServletContextResourceResolver(org.apache.cxf.transport.servlet.ServletContextResourceResolver) BusHolder(org.jboss.wsf.stack.cxf.configuration.BusHolder) ResourceManager(org.apache.cxf.resource.ResourceManager)

Example 3 with BusHolder

use of org.jboss.wsf.stack.cxf.configuration.BusHolder in project jbossws-cxf by jbossws.

the class BusDeploymentAspect method startDeploymentBus.

private void startDeploymentBus(final Deployment dep) {
    BusFactory.setThreadDefaultBus(null);
    ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
    try {
        final ArchiveDeployment aDep = (ArchiveDeployment) dep;
        final ResourceResolver deploymentResolver = aDep.getResourceResolver();
        final org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
        // set the runtime classloader (pointing to the deployment unit) to allow CXF accessing to the classes;
        // use origClassLoader (which on AS7 is set to ASIL aggregation module's classloader by TCCLDeploymentProcessor) as
        // parent to make sure user provided libs in the deployment do no mess up the WS endpoint's deploy if they duplicates
        // libraries already available on the application server modules.
        SecurityActions.setContextClassLoader(new DelegateClassLoader(dep.getClassLoader(), origClassLoader));
        DDBeans metadata = dep.getAttachment(DDBeans.class);
        BusHolder holder = new BusHolder(metadata);
        Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep), aDep);
        holder.configure(resolver, configurer, dep.getAttachment(JBossWebservicesMetaData.class), dep);
        dep.addAttachment(BusHolder.class, holder);
    } finally {
        BusFactory.setThreadDefaultBus(null);
        SecurityActions.setContextClassLoader(origClassLoader);
    }
}
Also used : DDBeans(org.jboss.wsf.stack.cxf.metadata.services.DDBeans) BusHolder(org.jboss.wsf.stack.cxf.configuration.BusHolder) JBossWSResourceResolver(org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver) ArchiveDeployment(org.jboss.wsf.spi.deployment.ArchiveDeployment) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData) ResourceResolver(org.jboss.wsf.spi.deployment.ResourceResolver) JBossWSResourceResolver(org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver) DelegateClassLoader(org.jboss.ws.common.utils.DelegateClassLoader) DelegateClassLoader(org.jboss.ws.common.utils.DelegateClassLoader) Configurer(org.apache.cxf.configuration.Configurer) BindingCustomization(org.jboss.ws.api.binding.BindingCustomization) WSDLFilePublisher(org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher)

Example 4 with BusHolder

use of org.jboss.wsf.stack.cxf.configuration.BusHolder in project jbossws-cxf by jbossws.

the class BusDeploymentAspect method stop.

@Override
public void stop(final Deployment dep) {
    final BusHolder holder = dep.removeAttachment(BusHolder.class);
    if (holder != null) {
        holder.close();
        WSDLFilePublisher wsdlFilePublisher = dep.getAttachment(WSDLFilePublisher.class);
        if (wsdlFilePublisher != null) {
            wsdlFilePublisher.unpublishWsdlFiles();
        }
    }
}
Also used : BusHolder(org.jboss.wsf.stack.cxf.configuration.BusHolder) WSDLFilePublisher(org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher)

Aggregations

BusHolder (org.jboss.wsf.stack.cxf.configuration.BusHolder)4 WSDLFilePublisher (org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher)2 DDBeans (org.jboss.wsf.stack.cxf.metadata.services.DDBeans)2 Configurer (org.apache.cxf.configuration.Configurer)1 ResourceManager (org.apache.cxf.resource.ResourceManager)1 ServletContextResourceResolver (org.apache.cxf.transport.servlet.ServletContextResourceResolver)1 BindingCustomization (org.jboss.ws.api.binding.BindingCustomization)1 DelegateClassLoader (org.jboss.ws.common.utils.DelegateClassLoader)1 ArchiveDeployment (org.jboss.wsf.spi.deployment.ArchiveDeployment)1 ResourceResolver (org.jboss.wsf.spi.deployment.ResourceResolver)1 JBossWebservicesMetaData (org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData)1 JBossWSResourceResolver (org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver)1 JBossWSTest (org.jboss.wsf.test.JBossWSTest)1 Test (org.junit.Test)1