tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r745897 - in /tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider: JMSBindingReferenceBindingProvider.java JMSResourceFactory.java JMSResourceFactoryImpl.java
Date Thu, 19 Feb 2009 15:27:55 GMT
Author: antelder
Date: Thu Feb 19 15:27:53 2009
New Revision: 745897

URL: http://svn.apache.org/viewvc?rev=745897&view=rev
Log:
TUSCANY-2859: Add a closeResponseConnection method to the JMSResourceFactory

Modified:
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
    tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java

Modified: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java?rev=745897&r1=745896&r2=745897&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
Thu Feb 19 15:27:53 2009
@@ -122,6 +122,7 @@
     public void stop() {
         try {
             jmsResourceFactory.closeConnection();
+            jmsResourceFactory.closeResponseConnection();
         } catch (JMSException e) {
             throw new JMSBindingException(e);
         }

Modified: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java?rev=745897&r1=745896&r2=745897&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
Thu Feb 19 15:27:53 2009
@@ -80,4 +80,6 @@
      */
     public abstract Session createResponseSession() throws JMSException, NamingException;
 
+    
+    public abstract void closeResponseConnection() throws JMSException;
 }

Modified: tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java?rev=745897&r1=745896&r2=745897&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
Thu Feb 19 15:27:53 2009
@@ -29,7 +29,6 @@
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
-import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants;
 import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
 
 /**
@@ -246,4 +245,19 @@
         return responseConnection;
     }
 
+    public void closeResponseConnection() throws JMSException {
+        if (responseConnection != null) {
+            try {
+                responseConnection.close();
+            } catch (JMSException e) {
+                // if using an embedded broker then when shutting down Tuscany the broker
may get closed
+                // before this stop method is called. I can't see how to detect that so for
now just
+                // ignore the exception if the message is that the transport is already disposed
+                if (!e.getMessage().contains("disposed")) {
+                    throw e;
+                }
+            }
+        }
+    }
+
 }



Mime
View raw message