#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

@@ -193,7 +193,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
// handled inside P.U.H. for now
//register((Updater)puh, PLUGIN, FILE, 0);
new NewsTimerTask(_context, this);
_context.simpleScheduler().addPeriodicEvent(new TaskCleaner(), TASK_CLEANER_TIME);
_context.simpleTimer2().addPeriodicEvent(new TaskCleaner(), TASK_CLEANER_TIME);
changeState(RUNNING);
if (_cmgr != null)
_cmgr.register(this);
@@ -1397,7 +1397,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
private void finishStatus(String msg) {
updateStatus(msg);
_context.simpleScheduler().addEvent(new StatusCleaner(msg), STATUS_CLEAN_TIME);
_context.simpleTimer2().addEvent(new StatusCleaner(msg), STATUS_CLEAN_TIME);
}
private class StatusCleaner implements SimpleTimer.TimedEvent {

View File

@@ -38,7 +38,7 @@ class NewsTimerTask implements SimpleTimer.TimedEvent {
delay += _context.random().nextLong(INITIAL_DELAY);
if (_log.shouldLog(Log.INFO))
_log.info("Scheduling first news check in " + DataHelper.formatDuration(delay));
ctx.simpleScheduler().addPeriodicEvent(this, delay, RUN_DELAY);
ctx.simpleTimer2().addPeriodicEvent(this, delay, RUN_DELAY);
// UpdateManager calls NewsFetcher to check the existing news at startup
}