A separate thread periodically tests the queue for alarms ready.
753754755756757758759760761762763764765766767
{ super.destroy(); _isActive = false; Alarm alarm = _alarm; _alarm = null; if (alarm != null) alarm.dequeue(); flush(); _logWriter.close(); }
288289290291292293294295296297
_ruleList.trimToSize(); register(); if (_depend.size() > 0) { _alarm = new Alarm(this); handleAlarm(_alarm); } }
373374375376377378379380381382383384385
for (Rule rule : ruleList) { // XXX: s/b Config.destroy(rule); rule.destroy(); } Alarm alarm = _alarm; _alarm = null; if (alarm != null) alarm.dequeue(); super.destroy(); }
286287288289290291292293294295
ResinSystem.getCurrent().start(); _lifecycle.toActive(); // valid checker new Alarm(this).queue(60000); } finally { thread.setContextClassLoader(oldLoader); } }
679680681682683684685
_initialExpires = initialExpires; _period = period; _delay = delay; _nextTime = initialExpires; _alarm = new Alarm(_name, this, loader); }
695696697698699700701
_initialExpires = initialExpires; _period = period; _delay = delay; _alarm = new Alarm(_name, this, loader); }
266267268269270271272273274
_rule = rule; _cron = cron; _isEnable = isEnable; String type = isEnable ? "enable" : "disable"; _alarm = new Alarm("rewrite-rule-" + type, this); queue(); }
277278279280281282283284285286287288289290
{ long now = Alarm.getCurrentTime(); long nextTime = _cron.nextTime(now); Alarm alarm = _alarm; if (alarm == null) return; _rule.setEnabled(_isEnable); alarm.queue(nextTime - now); }
301302303304305306307308309310311
queue(); } public void destroy() { Alarm alarm = _alarm; _alarm = null; if (alarm != null) alarm.dequeue(); }
152153154155156157158159160161
protected void init() throws Exception { initDatabase(); _alarm = new Alarm(new ExpireAlarm()); // _alarm.queue(_expireTimeout); _alarm.queue(0); }