[jbossws-commits] JBossWS SVN: r12513 - in stack/cxf/branches/no-spring-support: modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration and 2 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Jun 23 05:20:46 EDT 2010


Author: alessio.soldano at jboss.com
Date: 2010-06-23 05:20:45 -0400 (Wed, 23 Jun 2010)
New Revision: 12513

Modified:
   stack/cxf/branches/no-spring-support/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
   stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
   stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
   stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
   stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
   stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
   stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml
Log:
Changes for deploying spring libs in jbossws.deployer


Modified: stack/cxf/branches/no-spring-support/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
===================================================================
--- stack/cxf/branches/no-spring-support/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml	2010-06-22 11:32:27 UTC (rev 12512)
+++ stack/cxf/branches/no-spring-support/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml	2010-06-23 09:20:45 UTC (rev 12513)
@@ -44,14 +44,6 @@
     <include name="**/neethi.jar"/>
     <include name="**/saaj-api.jar"/>
     <include name="**/saaj-impl.jar"/>
-    <include name="**/spring-aop.jar"/>
-    <include name="**/spring-asm.jar"/>
-    <include name="**/spring-beans.jar"/>
-    <include name="**/spring-context.jar"/>
-    <include name="**/spring-core.jar"/>
-    <include name="**/spring-expression.jar"/>
-    <include name="**/spring-jms.jar"/>
-    <include name="**/spring-tx.jar"/>
     <include name="**/stax-api.jar"/>
     <include name="**/velocity.jar"/>
     <include name="**/wsdl4j.jar"/>
@@ -90,14 +82,6 @@
     <include name="**/neethi.jar"/>
     <include name="**/saaj-api.jar"/>
     <include name="**/saaj-impl.jar"/>
-    <include name="**/spring-aop.jar"/>
-    <include name="**/spring-asm.jar"/>
-    <include name="**/spring-beans.jar"/>
-    <include name="**/spring-context.jar"/>
-    <include name="**/spring-core.jar"/>
-    <include name="**/spring-expression.jar"/>
-    <include name="**/spring-jms.jar"/>
-    <include name="**/spring-tx.jar"/>
     <include name="**/XmlSchema.jar"/>
     <include name="**/xmlsec.jar"/>
     <include name="**/wsdl4j.jar"/>
@@ -108,6 +92,14 @@
     <include name="**/jbossws-cxf-client*.jar"/>
     <include name="**/jbossws-cxf-factories.jar"/>
     <include name="**/jbossws-cxf-server*.jar"/>
+    <include name="**/spring-aop.jar"/>
+    <include name="**/spring-asm.jar"/>
+    <include name="**/spring-beans.jar"/>
+    <include name="**/spring-context.jar"/>
+    <include name="**/spring-core.jar"/>
+    <include name="**/spring-expression.jar"/>
+    <include name="**/spring-jms.jar"/>
+    <include name="**/spring-tx.jar"/>
   </patternset>
 
   <!-- ================================================================== -->

Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java	2010-06-22 11:32:27 UTC (rev 12512)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java	2010-06-23 09:20:45 UTC (rev 12513)
@@ -21,8 +21,6 @@
  */
 package org.jboss.wsf.stack.cxf.configuration;
 
-import java.io.IOException;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.soap.SoapTransportFactory;
 import org.apache.cxf.configuration.Configurer;
@@ -64,9 +62,8 @@
     * @param soapTransportFactory   The SoapTransportFactory to configure, if any
     * @param resolver               The ResourceResolver to configure, if any
     * @param configurer             The JBossWSCXFConfigurer to install in the bus, if any
-    * @throws IOException           Throws IOException if the jboss-cxf.xml file can't be read
     */
-   protected void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer)
+   public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer)
    {
       if (configurer != null)
       {

Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java	2010-06-22 11:32:27 UTC (rev 12512)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java	2010-06-23 09:20:45 UTC (rev 12513)
@@ -52,10 +52,12 @@
 public class NonSpringBusHolder extends BusHolder
 {
    private boolean configured = false;
+   protected DDBeans metadata;
    
-   public NonSpringBusHolder()
+   public NonSpringBusHolder(DDBeans metadata)
    {
       super();
+      this.metadata = metadata;
       bus = new JBossWSNonSpringBusFactory().createBus();
       //Force servlet transport to prevent CXF from using Jetty as a transport
       ExtensionManager em = bus.getExtension(ExtensionManager.class);
@@ -70,13 +72,12 @@
     * Update the Bus held by the this instance using the provided parameters.
     * This basically prepares the bus for being used with JBossWS.
     * 
-    * @param jbossCxfXml    The location of the jboss-cxf.xml configuration file
     * @param soapTransportFactory   The SoapTransportFactory to configure, if any
     * @param resolver               The ResourceResolver to configure, if any
     * @param configurer             The JBossWSCXFConfigurer to install in the bus, if any
-    * @throws IOException           Throws IOException if the jboss-cxf.xml file can't be read
     */
-   public void configure(DDBeans metadata, SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer)
+   @Override
+   public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer)
    {
       if (configured)
       {

Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java	2010-06-22 11:32:27 UTC (rev 12512)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java	2010-06-23 09:20:45 UTC (rev 12513)
@@ -57,10 +57,12 @@
    private boolean configured = false;
    protected BusApplicationContext ctx ;
    protected List<GenericApplicationContext> additionalCtx = new LinkedList<GenericApplicationContext>();
+   protected URL[] additionalLocations;
    
-   public SpringBusHolder(URL location)
+   public SpringBusHolder(URL location, URL... additionalLocations)
    {
       super();
+      this.additionalLocations = additionalLocations;
       createBus(location);
    }
    
@@ -99,22 +101,31 @@
     * Update the Bus held by the this instance using the provided parameters.
     * This basically prepares the bus for being used with JBossWS.
     * 
-    * @param jbossCxfXml    The location of the jboss-cxf.xml configuration file
     * @param soapTransportFactory   The SoapTransportFactory to configure, if any
     * @param resolver               The ResourceResolver to configure, if any
     * @param configurer             The JBossWSCXFConfigurer to install in the bus, if any
-    * @throws IOException           Throws IOException if the jboss-cxf.xml file can't be read
     */
-   public void configure(URL jbossCxfXml, SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer) throws IOException
+   @Override
+   public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer)
    {
       if (configured)
       {
          throw new IllegalStateException("Underlying bus is already configured for JBossWS use!");
       }
       super.configure(soapTransportFactory, resolver, configurer);
-      if (jbossCxfXml != null)
+      if (additionalLocations != null)
       {
-         additionalCtx.add(loadAdditionalConfig(ctx, jbossCxfXml));
+         for (URL jbossCxfXml : additionalLocations)
+         {
+            try
+            {
+               additionalCtx.add(loadAdditionalConfig(ctx, jbossCxfXml));
+            }
+            catch (IOException e)
+            {
+               throw new RuntimeException("Unable to load configuration from " + jbossCxfXml, e);
+            }
+         }
       }
       configured = true;
    }

Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java	2010-06-22 11:32:27 UTC (rev 12512)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java	2010-06-23 09:20:45 UTC (rev 12513)
@@ -64,6 +64,7 @@
          org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
          Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
          String jbosswsCxfXml =  contextParams == null ? null : contextParams.get(BusHolder.PARAM_CXF_BEANS_URL);
+         BusHolder holder = null;
          
          if (jbosswsCxfXml != null) // Spring available
          {
@@ -76,26 +77,25 @@
             {
             } //ignore, cxf-servlet.xml is optional, we might even decide not to support this
    
-            SpringBusHolder holder = new SpringBusHolder(cxfServletURL);
             try
             {
+               holder = new SpringBusHolder(cxfServletURL, deploymentResolver.resolve(jbosswsCxfXml));
                Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep));
-               holder.configure(deploymentResolver.resolve(jbosswsCxfXml), new SoapTransportFactoryExt(), resolver, configurer);
+               holder.configure(new SoapTransportFactoryExt(), resolver, configurer);
             }
-            catch (IOException e)
+            catch (Exception e)
             {
                throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
             }
-            dep.addAttachment(BusHolder.class, holder);
          }
          else //Spring not available
          {
             DDBeans metadata = dep.getAttachment(DDBeans.class);
-            NonSpringBusHolder holder = new NonSpringBusHolder();
+            holder = new NonSpringBusHolder(metadata);
             Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep));
-            holder.configure(metadata, new SoapTransportFactoryExt(), resolver, configurer);
-            dep.addAttachment(BusHolder.class, holder);
+            holder.configure(new SoapTransportFactoryExt(), resolver, configurer);
          }
+         dep.addAttachment(BusHolder.class, holder);
       }
       finally
       {
@@ -105,7 +105,7 @@
          SecurityActions.setContextClassLoader(origClassLoader);
       }
    }
-
+   
    @Override
    public void stop(Deployment dep)
    {

Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java	2010-06-22 11:32:27 UTC (rev 12512)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java	2010-06-23 09:20:45 UTC (rev 12513)
@@ -64,7 +64,7 @@
    @Override
    public void start(Deployment dep)
    {
-      if (SpringUtils.isSpringAvailable(new ClassLoader[]{Thread.currentThread().getContextClassLoader(), dep.getRuntimeClassLoader()}))
+      if (SpringUtils.isSpringAvailable())
       {
          URL cxfURL = getCXFConfigFromClassLoader(dep);
          if (cxfURL == null)

Modified: stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml	2010-06-22 11:32:27 UTC (rev 12512)
+++ stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml	2010-06-23 09:20:45 UTC (rev 12513)
@@ -84,6 +84,34 @@
     </moduleSet>
     <moduleSet>
       <includes>
+        <include>org.jboss.ws.cxf:jbossws-cxf-client</include>
+        <include>org.jboss.ws.cxf:jbossws-cxf-server</include>
+      </includes>
+      <binaries>
+        <outputDirectory>lib</outputDirectory>
+        <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+        <unpack>false</unpack>
+        <dependencySets>
+          <dependencySet>
+            <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+            <useStrictFiltering>true</useStrictFiltering>
+            <scope>provided</scope>
+            <includes>
+              <include>org.springframework:spring-aop:jar</include>
+              <include>org.springframework:spring-asm:jar</include>
+              <include>org.springframework:spring-beans:jar</include>
+              <include>org.springframework:spring-context:jar</include>
+              <include>org.springframework:spring-core:jar</include>
+              <include>org.springframework:spring-expression:jar</include>
+              <include>org.springframework:spring-jms:jar</include>
+              <include>org.springframework:spring-tx:jar</include>
+            </includes>
+          </dependencySet>
+        </dependencySets>
+      </binaries>
+    </moduleSet>
+    <moduleSet>
+      <includes>
         <include>org.jboss.ws.cxf:jbossws-cxf-management</include>
       </includes>
       <binaries>



More information about the jbossws-commits mailing list