cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1037829 - in /cxf/branches/2.2.x-fixes: ./ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/
Date Mon, 22 Nov 2010 18:42:15 GMT
Author: dkulp
Date: Mon Nov 22 18:42:14 2010
New Revision: 1037829

URL: http://svn.apache.org/viewvc?rev=1037829&view=rev
Log:
Merged revisions 1037805 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes

................
  r1037805 | dkulp | 2010-11-22 13:02:20 -0500 (Mon, 22 Nov 2010) | 10 lines
  
  Merged revisions 1037791 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1037791 | dkulp | 2010-11-22 12:36:25 -0500 (Mon, 22 Nov 2010) | 2 lines
    
    [CXF-3096] JMS shouldn't close pre-configured SingleCOnnectionFactories
    Patch from Hartmut Lang applied
  ........
................

Added:
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConfigurationTest.java
      - copied unchanged from r1037805, cxf/branches/2.3.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConfigurationTest.java
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=1037829&r1=1037828&r2=1037829&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Mon Nov 22 18:42:14 2010
@@ -93,7 +93,8 @@ public class JMSConfiguration implements
     private boolean jmsProviderTibcoEms;
 
     private ConnectionFactory wrappedConnectionFactory;
-    
+    private boolean autoWrappedConnectionFactory;
+
     private JNDIConfiguration jndiConfig;
     
     public void ensureProperlyConfigured(org.apache.cxf.common.i18n.Message msg) {
@@ -134,7 +135,6 @@ public class JMSConfiguration implements
         this.autoResolveDestination = autoResolveDestination;
     }
 
-
     public boolean isUsingEndpointInfo() {
         return this.usingEndpointInfo;
     }
@@ -372,6 +372,7 @@ public class JMSConfiguration implements
         }
         return useConduitIdSelector;
     }
+
     public boolean isSetUseConduitIdSelector() {
         return useConduitIdSelector != null;
     }
@@ -429,6 +430,7 @@ public class JMSConfiguration implements
                     } else {
                         scf = new SingleConnectionFactory(connectionFactory);
                     }
+                    autoWrappedConnectionFactory = true;
                 } else {
                     scf = new SingleConnectionFactory102(connectionFactory, pubSubDomain);
                 }
@@ -443,17 +445,21 @@ public class JMSConfiguration implements
         }
         return wrappedConnectionFactory;
     }
+
     public ConnectionFactory getWrappedConnectionFactory() {
         return wrappedConnectionFactory;
     }
     
     public synchronized void destroyWrappedConnectionFactory() {
-        if (wrappedConnectionFactory instanceof SingleConnectionFactory) {
-            ((SingleConnectionFactory)wrappedConnectionFactory).destroy();
+        if (autoWrappedConnectionFactory
+            &&
+            wrappedConnectionFactory instanceof SingleConnectionFactory) {
+            ((SingleConnectionFactory) wrappedConnectionFactory).destroy();
             if (connectionFactory == wrappedConnectionFactory) {
                 connectionFactory = null;
             }
             wrappedConnectionFactory = null;
+            autoWrappedConnectionFactory = false;
         }
     }
     

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=1037829&r1=1037828&r2=1037829&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Mon Nov 22 18:42:14 2010
@@ -63,7 +63,6 @@ import org.apache.cxf.transport.jms.cont
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl.EndpointReferenceUtils;
 import org.springframework.jms.connection.JmsResourceHolder;
-import org.springframework.jms.connection.SingleConnectionFactory;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.core.MessageCreator;
 import org.springframework.jms.core.SessionCallback;
@@ -123,9 +122,7 @@ public class JMSDestination extends Abst
             // CXF-2788: SingleConnectionFactory ignores the call to
             // javax.jms.Connection#close(),
             // use this to really close the target connection.
-            if (jmsListener.getConnectionFactory() instanceof SingleConnectionFactory) {
-                ((SingleConnectionFactory)jmsListener.getConnectionFactory()).destroy();
-            }
+            jmsConfig.destroyWrappedConnectionFactory();
         }
     }
 



Mime
View raw message