geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r1100170 - in /geronimo/server/branches/2.1: ./ repository/org/apache/activemq/ repository/org/apache/activemq/activemq-core/4.1.2-G20100308/ repository/org/apache/activemq/activemq-core/4.1.2-G20110506/ repository/org/apache/activemq/activ...
Date Fri, 06 May 2011 11:25:48 GMT
Author: vamsic007
Date: Fri May  6 11:25:47 2011
New Revision: 1100170

URL: http://svn.apache.org/viewvc?rev=1100170&view=rev
Log:
GERONIMO-5950 "AMQ-3121: Avoid connection creation while creating XAResource if the connection
factory is not an xa connection factory"
 o Create a customized ActiveMQ 4.1.2 build for Geronimo 2.1.8. Jars changed are activemq-core
and activemq-ra.
 o Update server poms to use this build 4.1.2-G20110506.

Added:
    geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20110506.README.TXT
      - copied, changed from r1100140, geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20100308.README.TXT
    geronimo/server/branches/2.1/repository/org/apache/activemq/AMQ-3121-v412.patch
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar
  (with props)
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.md5
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.sha1
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar
  (with props)
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.md5
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.sha1
Removed:
    geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20100308.README.TXT
    geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20100308/
Modified:
    geronimo/server/branches/2.1/pom.xml

Modified: geronimo/server/branches/2.1/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/pom.xml?rev=1100170&r1=1100169&r2=1100170&view=diff
==============================================================================
--- geronimo/server/branches/2.1/pom.xml (original)
+++ geronimo/server/branches/2.1/pom.xml Fri May  6 11:25:47 2011
@@ -675,13 +675,13 @@
             <dependency>
                 <groupId>org.apache.activemq</groupId>
                 <artifactId>activemq-core</artifactId>
-                <version>4.1.2-G20100308</version>
+                <version>4.1.2-G20110506</version>
             </dependency>
 
             <dependency>
                 <groupId>org.apache.activemq</groupId>
                 <artifactId>activemq-ra</artifactId>
-                <version>4.1.2</version>
+                <version>4.1.2-G20110506</version>
             </dependency>
 
             <dependency>

Copied: geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20110506.README.TXT
(from r1100140, geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20100308.README.TXT)
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20110506.README.TXT?p2=geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20110506.README.TXT&p1=geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20100308.README.TXT&r1=1100140&r2=1100170&rev=1100170&view=diff
==============================================================================
--- geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20100308.README.TXT
(original)
+++ geronimo/server/branches/2.1/repository/org/apache/activemq/4.1.2-G20110506.README.TXT
Fri May  6 11:25:47 2011
@@ -1,6 +1,6 @@
 Private Build of ActiveMQ for Geronimo.   
 
-How to build ActiveMQ 4.1.2-G20090207:
+How to build ActiveMQ 4.1.2-G20110506:
 --------------------------------------
 Checkout the ActiveMQ 4.1.2 tag
   svn co https://svn.apache.org/repos/asf/activemq/tags/activemq-4.1.2 activemq-4.1.2
@@ -26,6 +26,7 @@ patch -p0 -u < AMQ-2094.patch
 patch -p0 -u < build.patch
 patch -p0 -u < AMQ-2346.patch
 patch -p0 -u < unitcasesfix.patch
+patch -p0 -u < AMQ-3121-v412.patch
 Answer 'y' to any prompts of "Reversed (or previously applied) patch detected!  Assume -R?
[n]"
 
 
@@ -34,20 +35,28 @@ Build ActiveMQ
   cd activemq-4.1.2
   mvn install
 Notes:
-  - we only need to build the activemq-core directory
-  - I used Sun 1.5.0_13 and Maven 2.0.9 on MacOSX to build the jar
+  - we only need to build the activemq-core and activemq-ra directories
+  - I used Sun 1.5.0_17 and Maven 2.0.11 on Windows XP to build the jar
 
   
 Copy patched activemq-core jar to appropriate filename
 ------------------------------------------------------
   cd activemq-4.1.2
-  cp activemq-core/target/activemq-core-4.1.2.jar <geronimo-root>/repository/org/apache/activemq/activemq-core/4.1.2-G20100308/activemq-core-4.1.2-G20100308.jar
+  cp activemq-core/target/activemq-core-4.1.2.jar <geronimo-root>/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar
+
+Copy patched activemq-ra jar to appropriate filename
+------------------------------------------------------
+  cd activemq-4.1.2
+  cp activemq-ra/target/activemq-ra-4.1.2.jar <geronimo-root>/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar
 
 Optional steps:
 ---------------
-  cd <geronimo-root>/repository/org/apache/activemq/activemq-core/4.1.2-G20100308
-  md5sum activemq-core-4.1.2-G20100308.jar > activemq-core-4.1.2-G20100308.jar.md5
-  sha1sum activemq-core-4.1.2-G20100308.jar > activemq-core-4.1.2-G20100308.jar.sha1
+  cd <geronimo-root>/repository/org/apache/activemq/activemq-core/4.1.2-G20110506
+  md5sum activemq-core-4.1.2-G20110506.jar > activemq-core-4.1.2-G20110506.jar.md5
+  sha1sum activemq-core-4.1.2-G20110506.jar > activemq-core-4.1.2-G20110506.jar.sha1
+  cd <geronimo-root>/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506
+  md5sum activemq-ra-4.1.2-G20110506.jar > activemq-ra-4.1.2-G20110506.jar.md5
+  sha1sum activemq-ra-4.1.2-G20110506.jar > activemq-ra-4.1.2-G20110506.jar.sha1
 
 
 How the patch (AMQ1272-stomp-auth-v412.patch) was created:

Added: geronimo/server/branches/2.1/repository/org/apache/activemq/AMQ-3121-v412.patch
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/AMQ-3121-v412.patch?rev=1100170&view=auto
==============================================================================
--- geronimo/server/branches/2.1/repository/org/apache/activemq/AMQ-3121-v412.patch (added)
+++ geronimo/server/branches/2.1/repository/org/apache/activemq/AMQ-3121-v412.patch Fri May
 6 11:25:47 2011
@@ -0,0 +1,108 @@
+Index: activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java
+===================================================================
+--- activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java	(revision
1100085)
++++ activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQResourceAdapter.java	(working
copy)
+@@ -19,6 +19,7 @@
+ 
+ import org.apache.activemq.ActiveMQConnection;
+ import org.apache.activemq.ActiveMQConnectionFactory;
++import org.apache.activemq.ActiveMQXAConnectionFactory;
+ import org.apache.activemq.RedeliveryPolicy;
+ import org.apache.activemq.broker.BrokerFactory;
+ import org.apache.activemq.broker.BrokerService;
+@@ -26,7 +27,6 @@
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ 
+-import javax.jms.Connection;
+ import javax.jms.JMSException;
+ import javax.jms.XAConnection;
+ import javax.jms.XASession;
+@@ -66,6 +66,7 @@
+     private String brokerXmlConfig;
+     private BrokerService broker;
+     private ActiveMQConnectionFactory connectionFactory;
++    private XAConnection cachedConnection;
+ 
+     public ActiveMQResourceAdapter() {
+     }
+@@ -172,6 +173,15 @@
+             ActiveMQEndpointActivationKey key = (ActiveMQEndpointActivationKey) endpointWorkers.keySet().iterator().next();
+             endpointDeactivation(key.getMessageEndpointFactory(), key.getActivationSpec());
+         }
++        if(cachedConnection != null) {
++        	try {
++        		log.debug("Closing cachedConnection... "+cachedConnection);
++        		cachedConnection.close();
++        		log.debug("Closed cachedConnection "+cachedConnection);
++        	} catch(Throwable ignored) {
++        	}
++        	cachedConnection = null;
++        }
+         if (broker != null) {
+             ServiceSupport.dispose(broker);
+             broker = null;
+@@ -255,23 +265,49 @@
+      * @see javax.resource.spi.ResourceAdapter#getXAResources(javax.resource.spi.ActivationSpec[])
+      */
+     public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException
{
+-        Connection connection = null;
+         try {
+-            connection = makeConnection();
+-            if (connection instanceof XAConnection) {
+-                XASession session = ((XAConnection) connection).createXASession();
+-                XAResource xaResource = session.getXAResource();
+-                return new XAResource[] { xaResource };
+-            } else {
+-                return new XAResource[] {};
++            ActiveMQConnectionFactory cf = connectionFactory == null ? createConnectionFactory(getInfo())
: connectionFactory;
++            if (!(cf instanceof ActiveMQXAConnectionFactory)) {
++                 return new XAResource[] {};
+             }
+-        } catch (JMSException e) {
+-            throw new ResourceException(e);
+-        } finally {
+-            try {
+-                connection.close();
+-            } catch (Throwable ignore) {
++            if(cachedConnection != null) {
++            	try { 
++            	    XAResource res = cachedConnection.createXASession().getXAResource();
++            	    log.debug("Created XA resource from cached connection "+cachedConnection);
++                    return new XAResource[] {res};
++                } catch(Throwable t) {
++                	log.debug("Failed to create XA resource from cached connection "+cachedConnection,
t);
++                	try {
++                		log.debug("Closing cachedConnection... "+cachedConnection);
++                		cachedConnection.close();
++                		log.debug("Closed cachedConnection "+cachedConnection);
++                	} catch(Throwable ignored) {
++                	}
++                	cachedConnection = null;
++                }
+             }
++            // Cached connection could not be used. Create a new connection, cache it and
serve the request.
++        	try {
++        	    cachedConnection = (XAConnection) makeConnection(getInfo(), cf);
++        	    XAResource res = cachedConnection.createXASession().getXAResource();
++        	    log.debug("Created XA resource from new connection "+cachedConnection);
++                return new XAResource[] {res};
++            } catch(Throwable t) {
++            	log.debug("Failed to create XA resource from new connection "+cachedConnection,
t);
++            	if(cachedConnection != null) {
++                    XAConnection temp = cachedConnection;
++            		cachedConnection = null;
++                	try {
++                		log.debug("Closing new connection... "+temp);
++                		temp.close();
++                		log.debug("Closed new connection "+temp);
++                	} catch(Throwable ignored) {
++                	}
++            	}
++            	throw new ResourceException(t);
++            }
++         } catch (JMSException e) {
++             throw new ResourceException(e);
+         }
+     }
+ 

Added: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar?rev=1100170&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.md5
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.md5?rev=1100170&view=auto
==============================================================================
--- geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.md5
(added)
+++ geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.md5
Fri May  6 11:25:47 2011
@@ -0,0 +1 @@
+97f72be0c5cc6d0e5e553886066ae9b9  activemq-core-4.1.2-G20110506.jar

Added: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.sha1
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.sha1?rev=1100170&view=auto
==============================================================================
--- geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.sha1
(added)
+++ geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-core/4.1.2-G20110506/activemq-core-4.1.2-G20110506.jar.sha1
Fri May  6 11:25:47 2011
@@ -0,0 +1 @@
+6a083ab1f9cc2fe41846bf759ef341a624bca168  activemq-core-4.1.2-G20110506.jar

Added: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar?rev=1100170&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.md5
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.md5?rev=1100170&view=auto
==============================================================================
--- geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.md5
(added)
+++ geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.md5
Fri May  6 11:25:47 2011
@@ -0,0 +1 @@
+2d8b94e1e17d49e494071f1ea0a9f874  activemq-ra-4.1.2-G20110506.jar

Added: geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.sha1
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.sha1?rev=1100170&view=auto
==============================================================================
--- geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.sha1
(added)
+++ geronimo/server/branches/2.1/repository/org/apache/activemq/activemq-ra/4.1.2-G20110506/activemq-ra-4.1.2-G20110506.jar.sha1
Fri May  6 11:25:47 2011
@@ -0,0 +1 @@
+1fba51f263dbffdc6ae431084aeaf84bcf7d5abf  activemq-ra-4.1.2-G20110506.jar



Mime
View raw message