A separate thread periodically tests the queue for alarms ready.
You should use Cron for slow requests. Alarm is only appropriate for very short jobs.
245246247248249250251252253254255
String name = hostName + contextPath; if (_distributionId == null) _distributionId = name; _alarm = new WeakAlarm(this); _sessionSaveSample = MeterService.createAverageMeter("Resin|Http|Session Save", "Size"); _admin = new SessionManagerAdmin(this); }
356357358359360361362363364365366
_archiveFormat = _rolloverPrefix + ".%Y%m%d.%H%M"; rolloverLog(); _rolloverListener = new RolloverAlarm(); _rolloverAlarm = new WeakAlarm(_rolloverListener); if (_nextPeriodEnd < 0 || nextDay < _nextPeriodEnd) { _rolloverAlarm.queue(DEFAULT_ROLLOVER_CHECK_PERIOD); } else if (_nextPeriodEnd <= now) {
124125126127128129130131132133134
_id = id; _containerRootDirectory = containerRootDirectory; _alarm = new WeakAlarm(this); _checkInterval = Environment.getDependencyCheckInterval(); _cronInterval = Environment.getDependencyCheckInterval(); if (_cronInterval < MIN_CRON_INTERVAL)
585586587588589590591592593594595
_idleTime = ProbeManager.createActiveTimeProbe("Resin|Database|Idle"); _activeTime = ProbeManager.createActiveTimeProbe("Resin|Database|Active"); registerSelf(); _alarm = new WeakAlarm(this); if (! (mcf instanceof ValidatingManagedConnectionFactory)) { // never check _lastValidCheckTime = Long.MAX_VALUE / 2; }
112113114115116117118119120121122
{ super(container); _containerRootDirectory = containerRootDirectory; _alarm = new WeakAlarm(this); _cronInterval = Environment.getDependencyCheckInterval(); if (_cronInterval < MIN_CRON_INTERVAL) _cronInterval = MIN_CRON_INTERVAL;
242243244245246247248249250251252
String name = hostName + contextPath; if (_distributionId == null) _distributionId = name; _alarm = new WeakAlarm(this); _sessionSaveSample = ProbeManager.createAverageProbe("Resin|WebApp|Session Save", "Size"); _admin = new SessionManagerAdmin(this); }
353354355356357358359360361362363
else _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H%M"; rolloverLog(); _rolloverAlarm = new WeakAlarm(new RolloverAlarm()); if (_nextPeriodEnd > 0 && _nextPeriodEnd < nextDay) { _rolloverAlarm.queueAt(_nextPeriodEnd); } else {