summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jms
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-12 13:10:56 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-12 13:10:56 +0000
commitd6c656f919cc307885a8de1c4becc945849d9f12 (patch)
tree106c3497c8feb03b761d7f5a7a561f68a514de60 /sca-java-2.x/trunk/modules/binding-jms
parente450eaa3fb7afec8ac9bffb8096279519e2fe1e8 (diff)
Validate that jndi lookup returns the expected jms destination type
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@984754 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java17
1 files changed, 17 insertions, 0 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 3bd7b8c345..2f5d2e2632 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
@@ -214,6 +214,23 @@ public class DefaultJMSServiceListener implements JMSServiceListener {
+ " listener");
}
+ // Make sure its the expected type (queue or topic)
+ String type = (destination instanceof Queue) ? JMSBindingConstants.DESTINATION_TYPE_QUEUE : JMSBindingConstants.DESTINATION_TYPE_TOPIC;
+ if ("jndi".equals(jmsBinding.getDestinationType())) {
+ jmsBinding.setDestinationType(type);
+ } else {
+ if (!type.equals(jmsBinding.getDestinationType())) {
+ throw new JMSBindingException("JMS Destination " + jmsBinding.getDestinationName()
+ + " expecting type of "
+ + jmsBinding.getDestinationType()
+ + " but found "
+ + type
+ + " while registering service "
+ + serviceName
+ + " listener");
+ }
+ }
+
return destination;
}