diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-08-30 21:55:30 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-08-30 21:55:30 +0000 |
commit | 8a60aeb871c4610fc5514b6e1c870d60d09e03b6 (patch) | |
tree | 81752ff8d9cf6b9c09908a1ac68a4da2329aabb3 | |
parent | 539cf5c3713be45fbba15a1ca5932f86c4c6fdbe (diff) | |
download | qpid-python-8a60aeb871c4610fc5514b6e1c870d60d09e03b6.tar.gz |
QPID-3395 Applied Pavel's patch with minor modifications.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1163422 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java b/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java index fec5af55c1..b480f56c07 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java @@ -36,6 +36,7 @@ import javax.jms.Queue; import javax.jms.Topic; import javax.naming.Context; import javax.naming.NamingException; +import javax.naming.ConfigurationException; import javax.naming.spi.InitialContextFactory; import org.apache.qpid.client.AMQConnectionFactory; @@ -139,7 +140,7 @@ public class PropertiesFileInitialContextFactory implements InitialContextFactor return new ReadOnlyContext(environment, data); } - protected void createConnectionFactories(Map data, Hashtable environment) + protected void createConnectionFactories(Map data, Hashtable environment) throws ConfigurationException { for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { @@ -157,7 +158,7 @@ public class PropertiesFileInitialContextFactory implements InitialContextFactor } } - protected void createDestinations(Map data, Hashtable environment) + protected void createDestinations(Map data, Hashtable environment) throws ConfigurationException { for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { @@ -225,7 +226,7 @@ public class PropertiesFileInitialContextFactory implements InitialContextFactor /** * Factory method to create new Connection Factory instances */ - protected ConnectionFactory createFactory(String url) + protected ConnectionFactory createFactory(String url) throws ConfigurationException { try { @@ -233,16 +234,18 @@ public class PropertiesFileInitialContextFactory implements InitialContextFactor } catch (URLSyntaxException urlse) { - _logger.warn("Unable to createFactories:" + urlse); - } + _logger.warn("Unable to create factory:" + urlse); - return null; + ConfigurationException ex = new ConfigurationException("Failed to parse entry: " + urlse + " due to : " + urlse.getMessage()); + ex.initCause(urlse); + throw ex; + } } /** * Factory method to create new Destination instances from an AMQP BindingURL */ - protected Destination createDestination(String str) + protected Destination createDestination(String str) throws ConfigurationException { try { @@ -252,7 +255,9 @@ public class PropertiesFileInitialContextFactory implements InitialContextFactor { _logger.warn("Unable to create destination:" + e, e); - return null; + ConfigurationException ex = new ConfigurationException("Failed to parse entry: " + str + " due to : " + e.getMessage()); + ex.initCause(e); + throw ex; } } |