summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-09-03 14:28:53 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-09-03 14:28:53 +0000
commit5a4791e08665108a6b3ad3e73102fa17bd1940da (patch)
treed8cad8d67dd8b7d23774b89df2a25f525bbb9807 /java/sca
parentb5be1db004856f6c7871ac3af7f6abd7f744d878 (diff)
Fix another case of needing to ignore an exception when closing a connection that has already been closed
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@691625 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
index 97dbc208a9..a1308d98cf 100644
--- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
+++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
@@ -101,7 +101,16 @@ public class JMSResourceFactory {
*/
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;
+ }
+ }
}
}