You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gd...@apache.org on 2004/07/17 05:48:57 UTC
cvs commit: incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode RemoteNodeMonitor.java
gdamour 2004/07/16 20:48:57
Modified: sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode
RemoteNodeMonitor.java
Log:
RemoteNodeMonitor was not dropping old neighbours as the timestamp test was wrong.
Revision Changes Path
1.3 +5 -5 incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode/RemoteNodeMonitor.java
Index: RemoteNodeMonitor.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode/RemoteNodeMonitor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RemoteNodeMonitor.java 8 Jul 2004 05:13:29 -0000 1.2
+++ RemoteNodeMonitor.java 17 Jul 2004 03:48:57 -0000 1.3
@@ -43,13 +43,13 @@
/**
* Number of milliseconds between two scans.
*/
- public static final long MONITOR_PERIOD = 2000l;
+ public static final long MONITOR_PERIOD = 500l;
/**
* Nodes which have been idle for more than this number of milliseconds
* are left.
*/
- public static final long IDLE_TIME = 10000l;
+ public static final long IDLE_TIME = 1000l;
/**
* Manager whose RemoteNodes are monitored.
@@ -142,15 +142,15 @@
Map.Entry entry = (Map.Entry) iter.next();
NodeInfo node = (NodeInfo) entry.getKey();
Long lastActivity = (Long)entry.getValue();
- if ( lastActivity.longValue() >
+ if ( lastActivity.longValue() <
System.currentTimeMillis() + IDLE_TIME ) {
try {
manager.leaveRemoteNode(node);
} catch (NodeException e) {
log.error("Can not leave " + node, e);
}
+ iter.remove();
}
- iter.remove();
}
}
}