You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2008/09/03 16:28:53 UTC

svn commit: r691625 - /tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java

Author: antelder
Date: Wed Sep  3 07:28:53 2008
New Revision: 691625

URL: http://svn.apache.org/viewvc?rev=691625&view=rev
Log:
Fix another case of needing to ignore an exception when closing a connection that has already been closed

Modified:
    tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java

Modified: tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java?rev=691625&r1=691624&r2=691625&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java (original)
+++ tuscany/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java Wed Sep  3 07:28:53 2008
@@ -101,7 +101,16 @@
      */
     public void closeConnection() throws JMSException {
         if (connection != null) {
-            connection.close();
+            try {
+                connection.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;
+                }
+            }
         }
     }