tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject svn commit: r1005650 - in /openejb/trunk/openejb3: ./ container/openejb-activemq4/src/main/java/org/apache/openejb/resource/activemq/ container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/
Date Thu, 07 Oct 2010 21:59:20 GMT
Author: andygumbrecht
Date: Thu Oct  7 21:59:20 2010
New Revision: 1005650

URL: http://svn.apache.org/viewvc?rev=1005650&view=rev
Log:
Latest MQ RA strategy checks state and flushes cached brokers.

Using stax:stax:1.2.0 

Modified:
    openejb/trunk/openejb3/container/openejb-activemq4/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ4Factory.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
    openejb/trunk/openejb3/pom.xml

Modified: openejb/trunk/openejb3/container/openejb-activemq4/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ4Factory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-activemq4/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ4Factory.java?rev=1005650&r1=1005649&r2=1005650&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-activemq4/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ4Factory.java
(original)
+++ openejb/trunk/openejb3/container/openejb-activemq4/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ4Factory.java
Thu Oct  7 21:59:20 2010
@@ -49,7 +49,7 @@ public class ActiveMQ4Factory implements
 
         BrokerService broker = brokers.get(brokerURI);
 
-        if (null == broker) {
+        if (null == broker || !broker.isStarted()) {
 
             URI uri = new URI(brokerURI.getRawSchemeSpecificPart());
             broker = BrokerFactory.createBroker(uri);

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java?rev=1005650&r1=1005649&r2=1005650&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
Thu Oct  7 21:59:20 2010
@@ -50,7 +50,7 @@ public class ActiveMQ5Factory implements
 
         BrokerService broker = brokers.get(brokerURI);
 
-        if (null == broker) {
+        if (null == broker || !broker.isStarted()) {
 
             final URI uri = new URI(brokerURI.getRawSchemeSpecificPart());
             broker = BrokerFactory.createBroker(uri);

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java?rev=1005650&r1=1005649&r2=1005650&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
Thu Oct  7 21:59:20 2010
@@ -24,6 +24,7 @@ import javax.resource.spi.ResourceAdapte
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.Properties;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.openejb.util.LogCategory;
@@ -197,12 +198,16 @@ public class ActiveMQResourceAdapter ext
 
         final Collection<BrokerService> brokers = ActiveMQFactory.getBrokers();
 
-        for(final BrokerService bs : brokers){
+        final Iterator<BrokerService> it = brokers.iterator();
+
+        while(it.hasNext()){
             try {
-                bs.waitUntilStopped();
+                it.next().waitUntilStopped();
             } catch (Throwable t) {
                 //Ignore
             }
+
+            it.remove();
         }
 
         org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB, "org.apache.openejb.util.resources").info("Stopped
ActiveMQ");

Modified: openejb/trunk/openejb3/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/pom.xml?rev=1005650&r1=1005649&r2=1005650&view=diff
==============================================================================
--- openejb/trunk/openejb3/pom.xml (original)
+++ openejb/trunk/openejb3/pom.xml Thu Oct  7 21:59:20 2010
@@ -732,9 +732,9 @@
         <version>2.7.1</version>
       </dependency>
       <dependency>
-        <groupId>javax.xml.stream</groupId>
-        <artifactId>stax-api</artifactId>
-        <version>1.0-2</version>
+        <groupId>stax</groupId>
+        <artifactId>stax</artifactId>
+        <version>1.2.0</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>



Mime
View raw message