forked from I2P_Developers/i2p.i2p
replace SimpleTimer2.getInstance() calls
This commit is contained in:
@ -160,7 +160,7 @@ class PeerCoordinator implements PeerListener
|
|||||||
// Install a timer to check the uploaders.
|
// Install a timer to check the uploaders.
|
||||||
// Randomize the first start time so multiple tasks are spread out,
|
// Randomize the first start time so multiple tasks are spread out,
|
||||||
// this will help the behavior with global limits
|
// this will help the behavior with global limits
|
||||||
timer = new CheckEvent(new PeerCheckerTask(_util, this));
|
timer = new CheckEvent(_util.getContext(), new PeerCheckerTask(_util, this));
|
||||||
timer.schedule((CHECK_PERIOD / 2) + _random.nextInt((int) CHECK_PERIOD));
|
timer.schedule((CHECK_PERIOD / 2) + _random.nextInt((int) CHECK_PERIOD));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,8 +170,8 @@ class PeerCoordinator implements PeerListener
|
|||||||
*/
|
*/
|
||||||
private static class CheckEvent extends SimpleTimer2.TimedEvent {
|
private static class CheckEvent extends SimpleTimer2.TimedEvent {
|
||||||
private final PeerCheckerTask _task;
|
private final PeerCheckerTask _task;
|
||||||
public CheckEvent(PeerCheckerTask task) {
|
public CheckEvent(I2PAppContext ctx, PeerCheckerTask task) {
|
||||||
super(SimpleTimer2.getInstance());
|
super(ctx.simpleTimer2());
|
||||||
_task = task;
|
_task = task;
|
||||||
}
|
}
|
||||||
public void timeReached() {
|
public void timeReached() {
|
||||||
|
@ -62,7 +62,7 @@ import net.i2p.util.SimpleTimer2;
|
|||||||
* @author Mark Wielaard (mark@klomp.org)
|
* @author Mark Wielaard (mark@klomp.org)
|
||||||
*/
|
*/
|
||||||
public class TrackerClient implements Runnable {
|
public class TrackerClient implements Runnable {
|
||||||
private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(TrackerClient.class);
|
private final Log _log;
|
||||||
private static final String NO_EVENT = "";
|
private static final String NO_EVENT = "";
|
||||||
private static final String STARTED_EVENT = "started";
|
private static final String STARTED_EVENT = "started";
|
||||||
private static final String COMPLETED_EVENT = "completed";
|
private static final String COMPLETED_EVENT = "completed";
|
||||||
@ -116,6 +116,7 @@ public class TrackerClient implements Runnable {
|
|||||||
String id = urlencode(snark.getID());
|
String id = urlencode(snark.getID());
|
||||||
_threadName = "TrackerClient " + id.substring(id.length() - 12);
|
_threadName = "TrackerClient " + id.substring(id.length() - 12);
|
||||||
_util = util;
|
_util = util;
|
||||||
|
_log = util.getContext().logManager().getLog(TrackerClient.class);
|
||||||
this.meta = meta;
|
this.meta = meta;
|
||||||
this.additionalTrackerURL = additionalTrackerURL;
|
this.additionalTrackerURL = additionalTrackerURL;
|
||||||
this.coordinator = coordinator;
|
this.coordinator = coordinator;
|
||||||
@ -183,7 +184,7 @@ public class TrackerClient implements Runnable {
|
|||||||
|
|
||||||
private class Runner extends SimpleTimer2.TimedEvent {
|
private class Runner extends SimpleTimer2.TimedEvent {
|
||||||
public Runner(long delay) {
|
public Runner(long delay) {
|
||||||
super(SimpleTimer2.getInstance(), delay);
|
super(_util.getContext().simpleTimer2(), delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void timeReached() {
|
public void timeReached() {
|
||||||
|
@ -86,7 +86,7 @@ class PeerManager {
|
|||||||
|
|
||||||
private class Reorg extends SimpleTimer2.TimedEvent {
|
private class Reorg extends SimpleTimer2.TimedEvent {
|
||||||
public Reorg() {
|
public Reorg() {
|
||||||
super(SimpleTimer2.getInstance(), REORGANIZE_TIME);
|
super(_context.simpleTimer2(), REORGANIZE_TIME);
|
||||||
}
|
}
|
||||||
public void timeReached() {
|
public void timeReached() {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user