diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-30 07:24:33 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-30 07:24:33 +0000 |
commit | d33c0c2b7141ed9dbf02e01ff094e6b0342275da (patch) | |
tree | a2dc7489c10c94821876f3734455e65d3174c49e /sca-java-2.x/trunk/modules/binding-jms-runtime/src | |
parent | 8518f228485265b9b0c51c5b6e822dfb2bd7b57d (diff) |
Update jms conection factory look up to check the type of the looked up object
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@990711 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java index 61080516b3..c0f063d377 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java @@ -128,10 +128,14 @@ public class JMSResourceFactoryImpl implements JMSResourceFactory { } protected void createConnection() throws NamingException, JMSException { - ConnectionFactory connectionFactory = (ConnectionFactory)jndiLookUp(connectionFactoryName); - if (connectionFactory == null) { + Object o = jndiLookUp(connectionFactoryName); + if (o == null) { throw new JMSBindingException("connection factory not found: " + connectionFactoryName); } + if (!(o instanceof ConnectionFactory)) { + throw new JMSBindingException("JNDI resource '" + connectionFactoryName +"' is not a JMS ConnectionFactory"); + } + ConnectionFactory connectionFactory = (ConnectionFactory)o; connection = connectionFactory.createConnection(); } |