public void execute(CommandContext commandContext) { JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); jobExecutorContext.getCurrentProcessorJobQueue().add(jobId); }
protected void hintJobExecutor(JobEntity job) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); TransactionListener transactionListener = null; if(job.isExclusive() && jobExecutorContext != null && jobExecutorContext.isExecutingExclusiveJob()) { // lock job & add to the queue of the current processor Date currentTime = ClockUtil.getCurrentTime(); job.setLockExpirationTime(new Date(currentTime.getTime() + jobExecutor.getLockTimeInMillis())); job.setLockOwner(jobExecutor.getLockOwner()); transactionListener = new ExclusiveJobAddedNotification(job.getId()); } else { // notify job executor: transactionListener = new MessageAddedNotification(jobExecutor); } Context.getCommandContext() .getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, transactionListener); }
JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); if(jobExecutorContext != null) { // if null, then we are not called by the job executor jobExecutorContext.setCurrentJob(job);
JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); if (jobExecutorContext != null) { // if null, then we are not called by the job executor jobExecutorContext.setCurrentJob(job);