public Void execute(CommandContext commandContext) { JobEntity job = getJob(); if (Context.getJobExecutorContext() == null) { EnsureUtil.ensureNotNull("Job with id " + jobId + " does not exist", "job", job); } else if (Context.getJobExecutorContext() != null && job == null) { // CAM-1842 // Job was acquired but does not exist anymore. This is not a problem. // It usually means that the job has been deleted after it was acquired which can happen if the // the activity instance corresponding to the job is cancelled. LOG.debugAcquiredJobNotFound(jobId); return null; } job.unlock(); return null; } }
public Void execute(CommandContext commandContext) { JobEntity job = getJob(); if (Context.getJobExecutorContext() == null) { EnsureUtil.ensureNotNull("Job with id " + jobId + " does not exist", "job", job); } else if (Context.getJobExecutorContext() != null && job == null) { // CAM-1842 // Job was acquired but does not exist anymore. This is not a problem. // It usually means that the job has been deleted after it was acquired which can happen if the // the activity instance corresponding to the job is cancelled. LOG.debugAcquiredJobNotFound(jobId); return null; } job.unlock(); return null; } }
protected void initializeEntityCache() { final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if(processEngineConfiguration != null && processEngineConfiguration.isDbEntityCacheReuseEnabled() && jobExecutorContext != null) { dbEntityCache = jobExecutorContext.getEntityCache(); if(dbEntityCache == null) { dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping()); jobExecutorContext.setEntityCache(dbEntityCache); } } else { if (processEngineConfiguration != null) { dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping()); } else { dbEntityCache = new DbEntityCache(); } } }
protected void initializeEntityCache() { final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if(processEngineConfiguration != null && processEngineConfiguration.isDbEntityCacheReuseEnabled() && jobExecutorContext != null) { dbEntityCache = jobExecutorContext.getEntityCache(); if(dbEntityCache == null) { dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping()); jobExecutorContext.setEntityCache(dbEntityCache); } } else { if (processEngineConfiguration != null) { dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping()); } else { dbEntityCache = new DbEntityCache(); } } }
protected void hintJobExecutor(JobEntity job) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); if (!jobExecutor.isActive()) { return; } JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); TransactionListener transactionListener = null; if(!job.isSuspended() && job.isExclusive() && jobExecutorContext != null && jobExecutorContext.isExecutingExclusiveJob() && areInSameProcessInstance(job, jobExecutorContext.getCurrentJob())) { // 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(), jobExecutorContext); } else { // notify job executor: transactionListener = new MessageAddedNotification(jobExecutor); } Context.getCommandContext() .getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, transactionListener); }
protected void hintJobExecutor(JobEntity job) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); if (!jobExecutor.isActive()) { return; } JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); TransactionListener transactionListener = null; if(!job.isSuspended() && job.isExclusive() && jobExecutorContext != null && jobExecutorContext.isExecutingExclusiveJob() && areInSameProcessInstance(job, jobExecutorContext.getCurrentJob())) { // 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(), jobExecutorContext); } else { // notify job executor: transactionListener = new MessageAddedNotification(jobExecutor); } Context.getCommandContext() .getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, transactionListener); }
final IdentityService identityService = processEngineConfiguration.getIdentityService(); final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
final IdentityService identityService = processEngineConfiguration.getIdentityService(); final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
public Void execute(CommandContext commandContext) { JobEntity job = getJob(); if (Context.getJobExecutorContext() == null) { EnsureUtil.ensureNotNull("Job with id " + jobId + " does not exist", "job", job); } else if (Context.getJobExecutorContext() != null && job == null) { // CAM-1842 // Job was acquired but does not exist anymore. This is not a problem. // It usually means that the job has been deleted after it was acquired which can happen if the // the activity instance corresponding to the job is cancelled. LOG.debugAcquiredJobNotFound(jobId); return null; } job.unlock(); return null; } }
protected void initializeEntityCache() { final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if(processEngineConfiguration != null && processEngineConfiguration.isDbEntityCacheReuseEnabled() && jobExecutorContext != null) { dbEntityCache = jobExecutorContext.getEntityCache(); if(dbEntityCache == null) { dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping()); jobExecutorContext.setEntityCache(dbEntityCache); } } else { if (processEngineConfiguration != null) { dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping()); } else { dbEntityCache = new DbEntityCache(); } } }
protected void hintJobExecutor(JobEntity job) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); if (!jobExecutor.isActive()) { return; } JobExecutorContext jobExecutorContext = Context.getJobExecutorContext(); TransactionListener transactionListener = null; if(!job.isSuspended() && job.isExclusive() && jobExecutorContext != null && jobExecutorContext.isExecutingExclusiveJob() && areInSameProcessInstance(job, jobExecutorContext.getCurrentJob())) { // 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(), jobExecutorContext); } else { // notify job executor: transactionListener = new MessageAddedNotification(jobExecutor); } Context.getCommandContext() .getTransactionContext() .addTransactionListener(TransactionState.COMMITTED, transactionListener); }
final IdentityService identityService = processEngineConfiguration.getIdentityService(); final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();