activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r652111 - in /activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra: ActiveMQConnectionSupport.java ActiveMQResourceAdapter.java
Date Tue, 29 Apr 2008 20:59:06 GMT
Author: chirino
Date: Tue Apr 29 13:59:06 2008
New Revision: 652111

URL: http://svn.apache.org/viewvc?rev=652111&view=rev
Log:
Fix for AMQ-1696

Modified:
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java?rev=652111&r1=652110&r2=652111&view=diff
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
(original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionSupport.java
Tue Apr 29 13:59:06 2008
@@ -70,7 +70,7 @@
      * @return the physical connection
      * @throws JMSException if the connection could not be established
      */
-    protected ActiveMQConnection makeConnection(
+    public ActiveMQConnection makeConnection(
             ActiveMQConnectionRequestInfo connectionRequestInfo,
             ActiveMQConnectionFactory connectionFactory) throws JMSException
     {

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java?rev=652111&r1=652110&r2=652111&view=diff
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
(original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
Tue Apr 29 13:59:06 2008
@@ -55,7 +55,8 @@
     private String brokerXmlConfig;
     private BrokerService broker;
     private Thread brokerStartThread;
-
+    private ActiveMQConnectionFactory connectionFactory;
+    
     /**
      * 
      */
@@ -98,14 +99,21 @@
      * @see org.apache.activemq.ra.MessageResourceAdapter#makeConnection()
      */
     public ActiveMQConnection makeConnection() throws JMSException {
-        return makeConnection(getInfo());
+        if( connectionFactory == null ) {
+            return makeConnection(getInfo());
+        } else {
+            return makeConnection(getInfo(), connectionFactory);
         }
+    }
 
     /**
      * @param activationSpec
      */
     public ActiveMQConnection makeConnection(MessageActivationSpec activationSpec) throws
JMSException {
-        ActiveMQConnectionFactory connectionFactory = createConnectionFactory(getInfo());
+        ActiveMQConnectionFactory connectionFactory = this.connectionFactory;
+        if (connectionFactory == null) {
+            connectionFactory = createConnectionFactory(getInfo());
+        }
         String userName = defaultValue(activationSpec.getUserName(), getInfo().getUserName());
         String password = defaultValue(activationSpec.getPassword(), getInfo().getPassword());
         String clientId = activationSpec.getClientId();
@@ -306,5 +314,13 @@
         return result;
     }
 
+    public ActiveMQConnectionFactory getConnectionFactory() {
+        return connectionFactory;
+    }
+
+    public void setConnectionFactory(ActiveMQConnectionFactory connectionFactory) {
+        this.connectionFactory = connectionFactory;
+    }
+
 
     }



Mime
View raw message