cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1037805 - in /cxf/branches/2.3.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:02:20 GMT
Author: dkulp
Date: Mon Nov 22 18:02:20 2010
New Revision: 1037805

URL: http://svn.apache.org/viewvc?rev=1037805&view=rev
Log:
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.3.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConfigurationTest.java
      - copied unchanged from r1037791, cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConfigurationTest.java
Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
    cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java

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

Modified: cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=1037805&r1=1037804&r2=1037805&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Mon Nov 22 18:02:20 2010
@@ -97,11 +97,11 @@ public class JMSConfiguration implements
     private String requestURI;
 
     private ConnectionFactory wrappedConnectionFactory;
-
+    private boolean autoWrappedConnectionFactory;
     private JNDIConfiguration jndiConfig;
 
     public void ensureProperlyConfigured(org.apache.cxf.common.i18n.Message msg) {
-        if (targetDestination == null ||  getOrCreateWrappedConnectionFactory() == null)
{
+        if (targetDestination == null || getOrCreateWrappedConnectionFactory() == null) {
             throw new ConfigurationException(msg);
         }
     }
@@ -138,7 +138,6 @@ public class JMSConfiguration implements
         this.autoResolveDestination = autoResolveDestination;
     }
 
-
     public boolean isUsingEndpointInfo() {
         return this.usingEndpointInfo;
     }
@@ -383,6 +382,7 @@ public class JMSConfiguration implements
         }
         return useConduitIdSelector;
     }
+
     public boolean isSetUseConduitIdSelector() {
         return useConduitIdSelector != null;
     }
@@ -440,6 +440,7 @@ public class JMSConfiguration implements
                     } else {
                         scf = new SingleConnectionFactory(connectionFactory);
                     }
+                    autoWrappedConnectionFactory = true;
                 } else {
                     @SuppressWarnings("deprecation")
                     SingleConnectionFactory scf2
@@ -458,17 +459,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.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=1037805&r1=1037804&r2=1037805&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Mon Nov 22 18:02:20 2010
@@ -59,7 +59,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;
@@ -119,9 +118,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