A separate thread periodically tests the queue for alarms ready.
660661662663664665666
_initialExpires = initialExpires; _period = period; _delay = delay; _nextTime = initialExpires; _alarm = new Alarm(_name, this, loader); }
676677678679680681682
_initialExpires = initialExpires; _period = period; _delay = delay; _alarm = new Alarm(_name, this, loader); }
11571158115911601161116211631164116511661167
enable(); wake(); _suspendAlarm = new Alarm(new SuspendReaper()); _suspendAlarm.queue(_suspendReaperTimeout); isValid = true; } finally { if (! isValid)
168916901691169216931694169516961697169816991700170117021703
if (log.isLoggable(Level.FINE)) log.fine(this + " closing"); super.destroy(); Alarm suspendAlarm = _suspendAlarm; _suspendAlarm = null; if (suspendAlarm != null) suspendAlarm.dequeue(); QServerSocket serverSocket = _serverSocket; _serverSocket = null; _selectManager = null;
216217218219220221222223224225
_isActive = true; assert(_task != null); _alarm = new Alarm("cron-resource", this, nextTime - now); if (log.isLoggable(Level.FINER)) log.finer(this + " started. Next event at " + new Date(nextTime)); }
225226227228229230231232233234235236237238239
} private void stop() { _isActive = false; Alarm alarm = _alarm; _alarm = null; if (alarm != null) alarm.dequeue(); if (_task instanceof Work) ((Work) _task).release(); else if (_task instanceof TimerTask) ((TimerTask) _task).cancel();
979899100101102103104
public void start() { long now = Alarm.getCurrentTime(); long nextTime = _trigger.nextTime(now); _alarm = new Alarm(this); // TODO Try a weak alarm instead. _alarm.queue(nextTime - now); }
153154155156157158159
TransactionImpl(TransactionManagerImpl manager) { _transactionManager = manager; _timeout = _transactionManager.getTimeout(); _status = Status.STATUS_NO_TRANSACTION; _alarm = new Alarm("xa-timeout", this, ClassLoader.getSystemClassLoader()); }
9899100101102103104105
public void start() { long now = Alarm.getCurrentTime(); long nextTime = _trigger.nextTime(now); _alarm = new Alarm(this); // TODO Try a weak alarm instead. _alarm.queueAt(nextTime); }
855856857858859860861862863864865
synchronized (_logLock) { closeLogStream(); } Alarm alarm = _rolloverAlarm; _rolloverAlarm = null; if (alarm != null) alarm.dequeue(); }