activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r383040 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
Date Sat, 04 Mar 2006 05:27:35 GMT
Author: chirino
Date: Fri Mar  3 21:27:32 2006
New Revision: 383040

URL: http://svn.apache.org/viewcvs?rev=383040&view=rev
Log:
simplified a little. 

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java?rev=383040&r1=383039&r2=383040&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java
Fri Mar  3 21:27:32 2006
@@ -36,10 +36,9 @@
     private final Log log = LogFactory.getLog(InactivityMonitor.class);
     
     private final long maxInactivityDuration;
-    private final AtomicBoolean cancled = new AtomicBoolean(false);
     private byte readCheckIteration=0;
 
-    private final AtomicBoolean commandSent=new AtomicBoolean(true);
+    private final AtomicBoolean commandSent=new AtomicBoolean(false);
     private final AtomicBoolean inSend=new AtomicBoolean(false);
 
     private final AtomicBoolean commandReceived=new AtomicBoolean(true);
@@ -56,13 +55,11 @@
     }
     
     public void stop() throws Exception {
-        if( cancled.compareAndSet(false, true) ) {
-            Scheduler.cancel(this);
-        }
+        Scheduler.cancel(this);
         next.stop();
     }
     
-    public void run() {
+    synchronized public void run() {
         switch(readCheckIteration) {
         case 0:
             writeCheck();
@@ -134,9 +131,7 @@
     }
     
     public void onException(IOException error) {
-        if( cancled.compareAndSet(false, true) ) {
-            Scheduler.cancel(this);
-        }
+        Scheduler.cancel(this);
         commandListener.onException(error);
     }
 }



Mime
View raw message