#1069: Deprecated SimpleScheduler and moved functionality into SimpleTimer2

This commit is contained in:
dev
2015-04-06 21:05:24 +00:00
parent 4d8e577ffd
commit facbe8f9a0
34 changed files with 149 additions and 51 deletions

View File

@ -328,7 +328,7 @@ public class I2PSnarkUtil {
return rv;
} catch (I2PException ie) {
_banlist.add(dest);
_context.simpleScheduler().addEvent(new Unbanlist(dest), 10*60*1000);
_context.simpleTimer2().addEvent(new Unbanlist(dest), 10*60*1000);
IOException ioe = new IOException("Unable to reach the peer " + peer);
ioe.initCause(ie);
throw ioe;

View File

@ -233,7 +233,7 @@ public class SnarkManager implements CompleteListener {
// only if default instance
if ("i2psnark".equals(_contextName))
// delay until UpdateManager is there
_context.simpleScheduler().addEvent(new Register(), 4*60*1000);
_context.simpleTimer2().addEvent(new Register(), 4*60*1000);
// Not required, Jetty has a shutdown hook
//_context.addShutdownTask(new SnarkManagerShutdown());
_idleChecker = new IdleChecker(this, _peerCoordinatorSet);
@ -2272,7 +2272,7 @@ public class SnarkManager implements CompleteListener {
dht.stop();
// Schedule this even for final shutdown, as there's a chance
// that it's just this webapp that is stopping.
_context.simpleScheduler().addEvent(new Disconnector(), 60*1000);
_context.simpleTimer2().addEvent(new Disconnector(), 60*1000);
addMessage(_("Closing I2P tunnel after notifying trackers."));
if (finalShutdown) {
try { Thread.sleep(5*1000); } catch (InterruptedException ie) {}