@Override public boolean removeJob(JobHandle jobHandle) { return timerService.removeJob(jobHandle); }
public void dispose() { // for ( TimerInstance timer : timers.values() ) { // timerService.removeJob( timer.getJobHandle() ); // } if (timerService instanceof RegisteredTimerServiceDelegate) { timers.clear(); return; } for (Iterator<TimerInstance> it = timers.values().iterator(); it.hasNext();) { TimerInstance timer = it.next(); timerService.removeJob(timer.getJobHandle()); it.remove(); } timerService.shutdown(); }
public void cancelTimer(long timerId) { try { kruntime.startOperation(); TimerInstance timer = timers.remove(timerId); if (timer != null) { timerService.removeJob(timer.getJobHandle()); } } finally { kruntime.endOperation(); } }
tm.getTimerService().removeJob(ctx.getJobHandle());
jobHandle = ((GlobalTimerService) timerService).buildJobHandleForContext(new TaskDeadlineJobContext(deadlineJob.getId(), task.getTaskData().getProcessInstanceId(), deploymentId)); timerService.removeJob(jobHandle); jobHandle = ((GlobalTimerService) timerService).buildJobHandleForContext(new TaskDeadlineJobContext(deadlineJob.getId(), task.getTaskData().getProcessInstanceId(), deploymentId)); timerService.removeJob(jobHandle);
public void unschedule(long taskId, Deadline deadline, DeadlineType type) { Task task = persistenceContext.findTask(taskId); String deploymentId = task.getTaskData().getDeploymentId(); Deadlines deadlines = ((InternalTask)task).getDeadlines(); TimerService timerService = TimerServiceRegistry.getInstance().get(deploymentId + TimerServiceRegistry.TIMER_SERVICE_SUFFIX); if (timerService != null && timerService instanceof GlobalTimerService) { TaskDeadlineJob deadlineJob = new TaskDeadlineJob(taskId, deadline.getId(), type, deploymentId, task.getTaskData().getProcessInstanceId()); logger.debug("unscheduling timer job for deadline {} {} and task {} using timer service {}", deadlineJob.getId(), deadline.getId(), taskId, timerService); JobHandle jobHandle = jobHandles.remove(deadlineJob.getId()); if (jobHandle == null) { jobHandle = ((GlobalTimerService) timerService).buildJobHandleForContext(new TaskDeadlineJobContext(deadlineJob.getId(), task.getTaskData().getProcessInstanceId(), deploymentId)); } timerService.removeJob(jobHandle); // mark the deadlines so they won't be rescheduled again deadline.setEscalated(true); } }
public void execute(JobContext c) { HelloWorldJobContext ctx = (HelloWorldJobContext) c; int counter = ctx.increaseCounter(); if ( counter > 3 ) { ctx.timeService.removeJob( ctx.getJobHandle() ); } ctx.getList().add( ((HelloWorldJobContext)ctx).getMessage() + " : " + counter); } }
@Override public boolean removeJob(JobHandle jobHandle) { return timerService.removeJob(jobHandle); }
public void dispose() { // for ( TimerInstance timer : timers.values() ) { // timerService.removeJob( timer.getJobHandle() ); // } if (timerService instanceof RegisteredTimerServiceDelegate) { timers.clear(); return; } for (Iterator<TimerInstance> it = timers.values().iterator(); it.hasNext();) { TimerInstance timer = it.next(); timerService.removeJob(timer.getJobHandle()); it.remove(); } timerService.shutdown(); }
public void cancelTimer(long timerId) { try { kruntime.startOperation(); TimerInstance timer = timers.remove(timerId); if (timer != null) { timerService.removeJob(timer.getJobHandle()); } } finally { kruntime.endOperation(); } }
tm.getTimerService().removeJob(ctx.getJobHandle());