A separate thread periodically tests the queue for alarms ready.
694695696697698699700701702703704
public void destroy() { _dataSource = null; _freeConn = null; Alarm alarm = _alarm; _alarm = null; if (alarm != null) alarm.dequeue(); }
141142143144145146147148149150
throws Exception { initDatabase(); _alarm = new Alarm(this); // _alarm.queue(_expireTimeout); _alarm.queue(0); }
607608609610611612613614615616617
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(); }
122123124125126127128
throw ConfigException.create(e); } super.init(); _alarm = new Alarm("rewrite-dispatch-import", this, _dependencyCheckInterval); }
259260261262263264265266267268269270271272273274275276
public void destroy() { try { _isDestroyed = true; Alarm alarm = _alarm; _alarm = null; MatchRule matchRule = _matchRule; _matchRule = null; if (alarm != null) alarm.dequeue(); if (matchRule != null) matchRule.destroy(); }
264265266267268269270271272273
_server.start(); _lifecycle.toActive(); // valid checker new Alarm(this).queue(60000); } finally { thread.setContextClassLoader(oldLoader); } }
71727374757677
private MailService _mailService = new MailService(); public BamMailService() { _alarm = new Alarm(this); }