public TimerJobInstance createTimerJobInstance( Job job, JobContext ctx, Trigger trigger, JobHandle handle, InternalSchedulerService scheduler) { Map<Long, TimerJobInstance> local = null; if (ctx instanceof ProcessJobContext) { int sessionId = ((ProcessJobContext) ctx).getSessionId(); Map<Long, TimerJobInstance> instances = timerInstances.get(sessionId); if (instances == null) { instances = new ConcurrentHashMap<Long, TimerJobInstance>(); timerInstances.put(sessionId, instances); } local = timerInstances.get(sessionId); } else { local = singleTimerInstances; } ctx.setJobHandle(handle); GlobalJpaTimerJobInstance jobInstance = new GlobalJpaTimerJobInstance( new SelfRemovalJob(job), new SelfRemovalJobContext(ctx, local), trigger, handle, scheduler); return jobInstance; }
public TimerJobInstance createTimerJobInstance( Job job, JobContext ctx, Trigger trigger, JobHandle handle, InternalSchedulerService scheduler) { ctx.setJobHandle(handle); return new JpaTimerJobInstance( new SelfRemovalJob(job), createJobContext(ctx), trigger, handle, scheduler); }