old TimerTask cleanup

This commit is contained in:
zzz
2011-06-16 20:57:13 +00:00
parent cb72bb0427
commit 4cff55daca
3 changed files with 2 additions and 8 deletions

View File

@ -24,7 +24,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.TimerTask;
import net.i2p.I2PAppContext;
@ -32,7 +31,7 @@ import net.i2p.I2PAppContext;
* TimerTask that checks for good/bad up/downloader. Works together
* with the PeerCoordinator to select which Peers get (un)choked.
*/
class PeerCheckerTask extends TimerTask
class PeerCheckerTask implements Runnable
{
private static final long KILOPERSECOND = 1024*(PeerCoordinator.CHECK_PERIOD/1000);
@ -54,8 +53,6 @@ class PeerCheckerTask extends TimerTask
List<Peer> peerList = coordinator.peerList();
if (peerList.isEmpty() || coordinator.halted()) {
coordinator.setRateHistory(0, 0);
if (coordinator.halted())
cancel();
return;
}

View File

@ -21,7 +21,6 @@
package org.klomp.snark;
import java.util.Iterator;
import java.util.TimerTask;
import net.i2p.data.DataHelper;
@ -29,7 +28,7 @@ import net.i2p.data.DataHelper;
* TimerTask that monitors the peers and total up/download speeds.
* Works together with the main Snark class to report periodical statistics.
*/
class PeerMonitorTask extends TimerTask
class PeerMonitorTask implements Runnable
{
final static long MONITOR_PERIOD = 10 * 1000; // Ten seconds.
private static final long KILOPERSECOND = 1024 * (MONITOR_PERIOD / 1000);

View File

@ -32,8 +32,6 @@ import java.util.List;
import java.util.Properties;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.Timer;
import java.util.TimerTask;
import net.i2p.I2PAppContext;
import net.i2p.client.streaming.I2PServerSocket;