activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r381761 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
Date Tue, 28 Feb 2006 19:47:40 GMT
Author: jstrachan
Date: Tue Feb 28 11:47:39 2006
New Revision: 381761

URL: http://svn.apache.org/viewcvs?rev=381761&view=rev
Log:
made it easier to copy connection factory objects

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java?rev=381761&r1=381760&r2=381761&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
Tue Feb 28 11:47:39 2006
@@ -58,7 +58,7 @@
  * @version $Revision: 1.9 $
  * @see javax.jms.ConnectionFactory
  */
-public class ActiveMQConnectionFactory extends JNDIBaseStorable implements ConnectionFactory,
QueueConnectionFactory, TopicConnectionFactory, StatsCapable {
+public class ActiveMQConnectionFactory extends JNDIBaseStorable implements ConnectionFactory,
QueueConnectionFactory, TopicConnectionFactory, StatsCapable, Cloneable {
 
     public static final String DEFAULT_BROKER_URL = "tcp://localhost:61616";
     public static final String DEFAULT_USER = null;
@@ -107,6 +107,18 @@
         this(createURI(brokerURL));
     }
 
+    /**
+     * Returns a copy of the given connection factory
+     */
+    public ActiveMQConnectionFactory copy() {
+        try {
+            return (ActiveMQConnectionFactory) super.clone();
+        }
+        catch (CloneNotSupportedException e) {
+            throw new RuntimeException("This should never happen: " + e, e);
+        }
+    }
+    
     /**
      * @param brokerURL
      * @return



Mime
View raw message