[jbossws-commits] JBossWS SVN: r13029 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect and 2 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Sep 27 04:46:24 EDT 2010


Author: jim.ma
Date: 2010-09-27 04:46:22 -0400 (Mon, 27 Sep 2010)
New Revision: 13029

Modified:
   stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
   stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
   stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/JMSEndpointDeploymentAspectDelegate.java
   stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java
   stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
Log:
[JBWS-2987]:Enable the JMSTransportTestCase;code cleanup;execute bus.shutdown() wether the BusHolderListener is preShutDown or not

Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java	2010-09-27 07:57:22 UTC (rev 13028)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java	2010-09-27 08:46:22 UTC (rev 13029)
@@ -91,11 +91,7 @@
     */
    public void close()
    {
-      //call bus shutdown unless the listener tells us shutdown has already been asked
-      if (busHolderListener != null && !busHolderListener.isPreShutdown())
-      {
-         bus.shutdown(true);
-      }
+      bus.shutdown(true);
       busHolderListener = null;
    }
    

Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java	2010-09-27 07:57:22 UTC (rev 13028)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java	2010-09-27 08:46:22 UTC (rev 13029)
@@ -176,6 +176,7 @@
       {
          gac.destroy();
       }
+      ctx.destroy();
       super.close();
    }
 

Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/JMSEndpointDeploymentAspectDelegate.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/JMSEndpointDeploymentAspectDelegate.java	2010-09-27 07:57:22 UTC (rev 13028)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/JMSEndpointDeploymentAspectDelegate.java	2010-09-27 08:46:22 UTC (rev 13029)
@@ -25,16 +25,10 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerRegistry;
-import org.apache.cxf.transport.jms.JMSConfiguration;
-import org.apache.cxf.transport.jms.JMSDestination;
 import org.jboss.wsf.common.integration.JMSDeploymentAspect;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
-import org.jboss.wsf.stack.cxf.configuration.BusHolder;
-import org.springframework.jms.connection.SingleConnectionFactory;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
 
 /**
  * To start the jms endpoints
@@ -42,9 +36,7 @@
  * @author <a href="ema at redhat.com">Jim Ma</a>
  */
 public class JMSEndpointDeploymentAspectDelegate extends JMSDeploymentAspect
-{  
-   private BusHolder busHolder = null;   
-   
+{      
    @Override
    public void start(Deployment dep)  
    {
@@ -58,8 +50,7 @@
          try
          {
             SecurityActions.setContextClassLoader(dep.getRuntimeClassLoader());
-            SpringBusFactory bf = new SpringBusFactory();
-            Bus bus = bf.createBus(url);
+            Bus bus = new JBossWSSpringBusFactory().createBus(url);
             dep.addAttachment(Bus.class, bus);
          }
          catch (Exception e)
@@ -71,6 +62,7 @@
          finally
          {
             BusFactory.setDefaultBus(null);
+            BusFactory.setThreadDefaultBus(null);
             SecurityActions.setContextClassLoader(origClassLoader);
          }
       }
@@ -80,44 +72,10 @@
    public void stop(Deployment dep)
    {
       log.debug("Undeploying jms endpoints in " + dep.getSimpleName());
-      if (busHolder != null && busHolder.getBus() != null)
+      if (dep.getAttachment(Bus.class) != null)
       {
-         //CXF uses WrappedConnectionFactory to create "jmsListener". DefaultMessageListenerContainer.shutdown() can not colse all the jms connections.  
-         //We need to explicitly call detroy() to close connection. This should be fixed in CXF side.
-         SingleConnectionFactory connectionFactory = null;
-         Server jmsServer = null;
-         ServerRegistry serRegistry = busHolder.getBus().getExtension(ServerRegistry.class);
-         for (Server server : serRegistry.getServers())
-         {
-            if (server.getDestination() != null && server.getDestination() instanceof JMSDestination)
-            {
-               JMSDestination jmsDestination = (JMSDestination) server.getDestination();
-               JMSConfiguration jmsConfig = jmsDestination.getJmsConfig();
-               if (jmsConfig.getWrappedConnectionFactory() != null
-                     && jmsConfig.getWrappedConnectionFactory() instanceof SingleConnectionFactory)
-               {
-                  connectionFactory = (SingleConnectionFactory) jmsConfig
-                        .getWrappedConnectionFactory();
-                  jmsServer = server;
-               }
-
-            }
-            
-         }
-         
-         if (jmsServer != null) 
-         {
-             jmsServer.stop();   
-         }
-               
-         if (connectionFactory != null) 
-         {
-            connectionFactory.destroy();
-         }
-         //TODO:Remove above code after fix CXF-2788
-         //close LifecycleListener if exists
-         busHolder.getBus().shutdown(false);
-         busHolder.close();
+         Bus bus = dep.getAttachment(Bus.class);
+         bus.shutdown(false);
       }
    }
 }

Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java	2010-09-27 07:57:22 UTC (rev 13028)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java	2010-09-27 08:46:22 UTC (rev 13029)
@@ -42,14 +42,10 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
-import org.apache.cxf.jaxws.ServiceImpl;
-import org.jboss.test.ws.jaxws.samples.jmsendpoints.jmstransport.JMSEndpointsTestCase;
 import org.jboss.wsf.common.DOMUtils;
 import org.jboss.wsf.common.ObjectNameFactory;
 import org.jboss.wsf.test.JBossWSTest;
@@ -197,5 +193,5 @@
          }
       }
    }
-  
+
 }

Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt	2010-09-27 07:57:22 UTC (rev 13028)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt	2010-09-27 08:46:22 UTC (rev 13029)
@@ -19,9 +19,6 @@
 # [JBWS-2397] Fix jbws1797 testcase
 org/jboss/test/ws/jaxws/jbws1797/**
 
-# [JBWS-2987] Review JMS integration
-org/jboss/test/ws/jaxws/samples/jmstransport/**
-
 # [JBAS-8363] Virtual host issue in JBossWeb
 org/jboss/test/ws/jaxws/jbws981/JBWS981TestCase.*
 



More information about the jbossws-commits mailing list