[hornetq-commits] JBoss hornetq SVN: r10149 - in branches/Branch_2_2_EAP/src/main/org/hornetq/core/server: impl and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jan 26 10:01:24 EST 2011


Author: ataylor
Date: 2011-01-26 10:01:24 -0500 (Wed, 26 Jan 2011)
New Revision: 10149

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/NodeManager.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/FileLockNodeManager.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/InVMNodeManager.java
Log:
https://issues.jboss.org/browse/JBPAPP-5781 - add flag to enable interrupting

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/NodeManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/NodeManager.java	2011-01-26 03:42:42 UTC (rev 10148)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/NodeManager.java	2011-01-26 15:01:24 UTC (rev 10149)
@@ -72,4 +72,6 @@
    public abstract boolean isAwaitingFailback() throws Exception;
 
    public abstract boolean isBackupLive() throws Exception;
+
+   public abstract void interrupt();
 }

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/FileLockNodeManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/FileLockNodeManager.java	2011-01-26 03:42:42 UTC (rev 10148)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/FileLockNodeManager.java	2011-01-26 15:01:24 UTC (rev 10149)
@@ -63,7 +63,9 @@
 
    private final String directory;
 
+   boolean interrupted = false;
 
+
    public FileLockNodeManager(final String directory)
    {
       this.directory = directory;
@@ -137,7 +139,14 @@
          return false;
       }
    }
+
    @Override
+   public void interrupt()
+   {
+      interrupted = true;
+   }
+
+   @Override
    public void releaseBackup() throws Exception
    {
       releaseBackupLock();
@@ -332,8 +341,9 @@
                   //
                }
             }
-            if (Thread.currentThread().isInterrupted())
+            if (interrupted)
             {
+               interrupted = false;
                throw new IOException(new InterruptedException());
             }
          }

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2011-01-26 03:42:42 UTC (rev 10148)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2011-01-26 15:01:24 UTC (rev 10149)
@@ -455,6 +455,8 @@
 
             while (backupActivationThread.isAlive() && System.currentTimeMillis() - start < timeout)
             {
+               nodeManager.interrupt();
+
                backupActivationThread.interrupt();
 
                Thread.sleep(1000);

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/InVMNodeManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/InVMNodeManager.java	2011-01-26 03:42:42 UTC (rev 10148)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/InVMNodeManager.java	2011-01-26 15:01:24 UTC (rev 10149)
@@ -128,6 +128,12 @@
       return liveLock.availablePermits() == 0;
    }
 
+   @Override
+   public void interrupt()
+   {
+      //To change body of implemented methods use File | Settings | File Templates.
+   }
+
    private void releaseBackupNode()
    {
       if(backupLock != null)



More information about the hornetq-commits mailing list