diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-13 12:26:21 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-13 12:26:21 +0000 |
commit | 7c39643f218f7169bae9e7e4581e6a92d5c50c34 (patch) | |
tree | 163e724fb7e8059cbbd7508ad77359145ba7b30c /sca-java-2.x/trunk | |
parent | 4dfee8d6dfb0e0a33ada41d3bcd1869fe84be68d (diff) |
Don't do create-if-not-exist when using the jms:jndi: url format, and don't wrap jms exceptions in another jms exception
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@985173 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
3 files changed, 7 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java index 2f5d2e2632..aca0d58697 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java @@ -73,6 +73,7 @@ public class DefaultJMSServiceListener implements JMSServiceListener { try { registerListerner(); } catch (Exception e) { + if (e instanceof JMSBindingException) throw (JMSBindingException)e; throw new JMSBindingException("Error starting JMSServiceBinding", e); } } @@ -188,7 +189,8 @@ public class DefaultJMSServiceListener implements JMSServiceListener { } else if (qCreateMode.equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) { // In this mode, the queue may nor may not exist. It will be created if it does not exist - if (destination == null) { + // but don't create when using jms:jndi uri format + if (destination == null && !"jndi".equals(jmsBinding.getDestinationType())) { destination = jmsResourceFactory.createDestination(jmsBinding.getDestinationName()); } diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java index e842baaf6d..a133cce5d4 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java @@ -157,6 +157,7 @@ public class JMSBindingServiceBindingProvider implements EndpointProvider, JMSSe serviceListener.start(); } catch (Exception e) { + if (e instanceof JMSBindingException) throw (JMSBindingException)e; throw new JMSBindingException("Error starting JMSServiceBinding", e); } } @@ -165,6 +166,7 @@ public class JMSBindingServiceBindingProvider implements EndpointProvider, JMSSe try { serviceListener.stop(); } catch (Exception e) { + if (e instanceof JMSBindingException) throw (JMSBindingException)e; throw new JMSBindingException("Error stopping JMSServiceBinding", e); } } diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java index 0f4f88dcd8..b578d7e2a5 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java @@ -153,7 +153,8 @@ public class RRBJMSBindingInvoker implements Invoker { } else if (qCreateMode.equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) { // In this mode, the queue may nor may not exist. It will be created if it does not exist - if (dest == null) { + // but don't create when using jms:jndi uri format + if (dest == null && !"jndi".equals(jmsBinding.getDestinationType())) { dest = jmsResourceFactory.createDestination(queueName); } |