public void destroy() { Collection<List<GlobalJobHandle>> activeTimers = timerJobsPerSession.values(); for (List<GlobalJobHandle> handles : activeTimers) { for (GlobalJobHandle handle : handles) { this.schedulerService.removeJob(handle); } } }
@Override public boolean removeJob(JobHandle jobHandle) { if (jobHandle == null) { return false; } long sessionId = ((GlobalJobHandle) jobHandle).getSessionId(); List<GlobalJobHandle> handles = timerJobsPerSession.get(sessionId); if (handles == null) { logger.debug("No known job handles for session {}", sessionId); return this.schedulerService.removeJob(jobHandle); } if (handles.contains(jobHandle)) { logger.debug("Found match so removing job handle {} from sessions {} handles", jobHandle, sessionId); handles.remove(jobHandle); if (handles.isEmpty()) { timerJobsPerSession.remove(sessionId); } return this.schedulerService.removeJob(jobHandle); } else { logger.debug("No match for job handle {} within handles of session {}", jobHandle, sessionId); return false; } }
public void destroy() { Collection<List<GlobalJobHandle>> activeTimers = timerJobsPerSession.values(); for (List<GlobalJobHandle> handles : activeTimers) { for (GlobalJobHandle handle : handles) { this.schedulerService.removeJob(handle); } } }
@Override public boolean removeJob(JobHandle jobHandle) { if (jobHandle == null) { return false; } long sessionId = ((GlobalJobHandle) jobHandle).getSessionId(); List<GlobalJobHandle> handles = timerJobsPerSession.get(sessionId); if (handles == null) { logger.debug("No known job handles for session {}", sessionId); return this.schedulerService.removeJob(jobHandle); } if (handles.contains(jobHandle)) { logger.debug("Found match so removing job handle {} from sessions {} handles", jobHandle, sessionId); handles.remove(jobHandle); if (handles.isEmpty()) { timerJobsPerSession.remove(sessionId); } return this.schedulerService.removeJob(jobHandle); } else { logger.debug("No match for job handle {} within handles of session {}", jobHandle, sessionId); return false; } }