Search in sources :

Example 1 with DDBeans

use of org.jboss.wsf.stack.cxf.metadata.services.DDBeans in project jbossws-cxf by jbossws.

the class BusHolderTest method setupPropertyAndGetAlternativeSelector.

private static String setupPropertyAndGetAlternativeSelector(String alternative) {
    JBossWebservicesMetaData wsmd = null;
    if (alternative != null) {
        Map<String, String> props = new HashMap<String, String>();
        props.put(Constants.CXF_POLICY_ALTERNATIVE_SELECTOR_PROP, alternative);
        wsmd = new JBossWebservicesMetaData(null, null, null, null, props, null, null);
    }
    BusHolder holder = new BusHolder(new DDBeans());
    try {
        Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
        dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
        holder.configure(null, null, wsmd, dep);
        return holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
    } finally {
        holder.close();
    }
}
Also used : DDBeans(org.jboss.wsf.stack.cxf.metadata.services.DDBeans) DefaultDeploymentModelFactory(org.jboss.ws.common.deployment.DefaultDeploymentModelFactory) HashMap(java.util.HashMap) JBossWebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData) SOAPAddressRewriteMetadata(org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata) Deployment(org.jboss.wsf.spi.deployment.Deployment) PolicyEngine(org.apache.cxf.ws.policy.PolicyEngine)

Example 2 with DDBeans

use of org.jboss.wsf.stack.cxf.metadata.services.DDBeans in project jbossws-cxf by jbossws.

the class MetadataBuilder method build.

public DDBeans build(Deployment dep) {
    final SOAPAddressRewriteMetadata sarm = dep.getAttachment(SOAPAddressRewriteMetadata.class);
    Map<QName, String> serviceNameAddressMap = new HashMap<QName, String>();
    Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers = new HashMap<String, SOAPAddressWSDLParser>();
    DDBeans dd = new DDBeans();
    for (Endpoint ep : dep.getService().getEndpoints()) {
        DDEndpoint ddep = createDDEndpoint(ep.getTargetBeanClass(), (ArchiveDeployment) dep, ep);
        if (ep instanceof HttpEndpoint) {
            ddep.setInvoker(JBossWSInvoker.class.getName());
        }
        processWSDDContribution(ddep, (ArchiveDeployment) dep);
        URL wsdlLocation = getWsdlLocationURL(ddep, ((ArchiveDeployment) dep).getResourceResolver());
        processAddressRewrite(ddep, wsdlLocation, sarm, soapAddressWsdlParsers);
        METADATA_LOGGER.addingServiceEndpointMetadata(METADATA_LOGGER.isDebugEnabled() ? ddep.toStringExtended() : ddep.toString());
        dd.addEndpoint(ddep);
        serviceNameAddressMap.put(ddep.getServiceName(), ddep.getAddress());
    }
    dep.setProperty("ServiceAddressMap", serviceNameAddressMap);
    return dd;
}
Also used : DDBeans(org.jboss.wsf.stack.cxf.metadata.services.DDBeans) DDEndpoint(org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) SOAPAddressRewriteMetadata(org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata) HttpEndpoint(org.jboss.wsf.spi.deployment.HttpEndpoint) URL(java.net.URL) JBossWSInvoker(org.jboss.wsf.stack.cxf.JBossWSInvoker) HttpEndpoint(org.jboss.wsf.spi.deployment.HttpEndpoint) DDEndpoint(org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint) Endpoint(org.jboss.wsf.spi.deployment.Endpoint) SOAPAddressWSDLParser(org.jboss.ws.common.deployment.SOAPAddressWSDLParser)

Example 3 with DDBeans

use of org.jboss.wsf.stack.cxf.metadata.services.DDBeans 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 4 with DDBeans

use of org.jboss.wsf.stack.cxf.metadata.services.DDBeans 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

DDBeans (org.jboss.wsf.stack.cxf.metadata.services.DDBeans)4 HashMap (java.util.HashMap)2 SOAPAddressRewriteMetadata (org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata)2 JBossWebservicesMetaData (org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData)2 BusHolder (org.jboss.wsf.stack.cxf.configuration.BusHolder)2 URL (java.net.URL)1 QName (javax.xml.namespace.QName)1 Configurer (org.apache.cxf.configuration.Configurer)1 PolicyEngine (org.apache.cxf.ws.policy.PolicyEngine)1 BindingCustomization (org.jboss.ws.api.binding.BindingCustomization)1 DefaultDeploymentModelFactory (org.jboss.ws.common.deployment.DefaultDeploymentModelFactory)1 SOAPAddressWSDLParser (org.jboss.ws.common.deployment.SOAPAddressWSDLParser)1 DelegateClassLoader (org.jboss.ws.common.utils.DelegateClassLoader)1 ArchiveDeployment (org.jboss.wsf.spi.deployment.ArchiveDeployment)1 Deployment (org.jboss.wsf.spi.deployment.Deployment)1 Endpoint (org.jboss.wsf.spi.deployment.Endpoint)1 HttpEndpoint (org.jboss.wsf.spi.deployment.HttpEndpoint)1 ResourceResolver (org.jboss.wsf.spi.deployment.ResourceResolver)1 JBossWSInvoker (org.jboss.wsf.stack.cxf.JBossWSInvoker)1 WSDLFilePublisher (org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher)1