activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r603952 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/kaha/impl/KahaStore.java main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
Date Thu, 13 Dec 2007 16:52:28 GMT
Author: rajdavies
Date: Thu Dec 13 08:52:27 2007
New Revision: 603952

URL: http://svn.apache.org/viewvc?rev=603952&view=rev
Log:
try and ensure that the brokers shutdown cleanly for the 
ReliableReconnectTest - as it can hang

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java?rev=603952&r1=603951&r2=603952&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
Thu Dec 13 08:52:27 2007
@@ -108,6 +108,7 @@
             closed = true;
             if (initialized) {
                 unlock();
+                lockFile.close();
 
                 for (ListContainerImpl container : lists.values()) {
                     container.close();

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java?rev=603952&r1=603951&r2=603952&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
Thu Dec 13 08:52:27 2007
@@ -253,11 +253,11 @@
         if (!started.compareAndSet(true, false)) {
             return;
         }
+        unlock();
         if (lockFile != null) {
             lockFile.close();
             lockFile = null;
         }
-        unlock();
         this.usageManager.getMemoryUsage().removeUsageListener(this);
         synchronized (this) {
             Scheduler.cancel(periodicCheckpointTask);
@@ -890,9 +890,12 @@
         if (!disableLocking && (null != lock)) {
             //clear property doesn't work on some platforms
             System.getProperties().remove(getPropertyKey());
+            System.clearProperty(getPropertyKey());
+            assert(System.getProperty(getPropertyKey())==null);
             if (lock.isValid()) {
                 lock.release();
                 lock.channel().close();
+                
             }
             lock = null;
         }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java?rev=603952&r1=603951&r2=603952&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
Thu Dec 13 08:52:27 2007
@@ -68,6 +68,12 @@
         topic = true;
         destination = createDestination(getClass().getName());
     }
+    
+    protected void tearDown() throws Exception {
+        if (broker!=null) {
+            broker.stop();
+        }
+    }
 
     public ActiveMQConnectionFactory getConnectionFactory() throws Exception {
         String url = "failover://" + DEFAULT_BROKER_URL;
@@ -77,6 +83,7 @@
     protected void startBroker() throws JMSException {
         try {
             broker = BrokerFactory.createBroker(new URI("broker://()/localhost"));
+            broker.setUseShutdownHook(false);
             broker.addConnector(DEFAULT_BROKER_URL);
             broker.start();
         } catch (Exception e) {



Mime
View raw message