activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1150917 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
Date Mon, 25 Jul 2011 21:25:40 GMT
Author: tabish
Date: Mon Jul 25 21:25:39 2011
New Revision: 1150917

URL: http://svn.apache.org/viewvc?rev=1150917&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-3414

use schedule instead of scheduleAtFixedRate since we don't need read or write check tasks
to "catch up" if delayed for some reason only to fire once the resources allow for it and
then return to the standard delay for the next execution.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java?rev=1150917&r1=1150916&r2=1150917&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
Mon Jul 25 21:25:39 2011
@@ -315,8 +315,8 @@ public class InactivityMonitor extends T
                     WRITE_CHECK_TIMER = new Timer("InactivityMonitor WriteCheck",true);
                 }
                 CHECKER_COUNTER++;
-                WRITE_CHECK_TIMER.scheduleAtFixedRate(writeCheckerTask, initialDelayTime,writeCheckTime);
-                READ_CHECK_TIMER.scheduleAtFixedRate(readCheckerTask, initialDelayTime,readCheckTime);
+                WRITE_CHECK_TIMER.schedule(writeCheckerTask, initialDelayTime, writeCheckTime);
+                READ_CHECK_TIMER.schedule(readCheckerTask, initialDelayTime, readCheckTime);
             }
         }
     }
@@ -356,8 +356,8 @@ public class InactivityMonitor extends T
                 READ_CHECK_TIMER.purge();
                 CHECKER_COUNTER--;
                 if(CHECKER_COUNTER==0) {
-                    WRITE_CHECK_TIMER.cancel();
-                    READ_CHECK_TIMER.cancel();
+                  WRITE_CHECK_TIMER.cancel();
+                  READ_CHECK_TIMER.cancel();
                     WRITE_CHECK_TIMER = null;
                     READ_CHECK_TIMER = null;
                     ASYNC_TASKS.shutdownNow();



Mime
View raw message