Search in sources :

Example 1 with ResourceResolver

use of org.jboss.wsf.spi.deployment.ResourceResolver 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)

Aggregations

Configurer (org.apache.cxf.configuration.Configurer)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 BusHolder (org.jboss.wsf.stack.cxf.configuration.BusHolder)1 WSDLFilePublisher (org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher)1 DDBeans (org.jboss.wsf.stack.cxf.metadata.services.DDBeans)1 JBossWSResourceResolver (org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver)1