svn commit: r889447 - /jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ConnectionFactory.java

[email protected]
Newsgroups gmane.comp.jakarta.jmeter.devel
Message-ID <[email protected]>
Author: sebb
Date: Thu Dec 10 22:41:01 2009
New Revision: 889447

URL: http://svn.apache.org/viewvc?rev=889447&view=rev
Log:
Always return a valid topic connection

Modified:
    jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ConnectionFactory.java

Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ConnectionFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ConnectionFactory.java?rev=889447&r1=889446&r2=889447&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ConnectionFactory.java (original)
+++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ConnectionFactory.java Thu Dec 10 22:41:01 2009
@@ -148,15 +148,17 @@
          return qfactory;
     }
 
-    public static synchronized TopicConnection getTopicConnection() {
+    /**
+     * Use the factory to create a topic connection.
+     * 
+     * @return the connection
+     * @throws JMSException if the factory is null or the create() method fails
+     */
+    public static synchronized TopicConnection getTopicConnection() throws JMSException {
         if (factory != null) {
-            try {
-                return factory.createTopicConnection();
-            } catch (JMSException e) {
-                log.error(e.getMessage());
-            }
+            return factory.createTopicConnection();
         }
-        return null;
+        throw new JMSException("Factory has not been initialised");
     }
 
     public static synchronized QueueConnection getQueueConnection(Context ctx, String queueConn) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.