@Override protected void doStart() { log.trace("ReservationCacheImpl.doStart()"); try { schedulerService.startAsync().awaitRunning(); cacheCleanupSchedule = schedulerService.scheduleAtFixedRate(cleanUpCacheRunnable, 1, 1, TimeUnit.MINUTES); notifyStarted(); } catch (Exception e) { notifyFailed(e); } }
@Override protected void doStop() { log.trace("ReservationCacheImpl.doStop()"); try { cacheCleanupSchedule.cancel(true); cacheCleanupSchedule = null; schedulerService.stopAsync().awaitTerminated(); notifyStopped(); } catch (Exception e) { notifyFailed(e); } }