public void run() { final JobExecutorContext jobExecutorContext = new JobExecutorContext(); final List<String> currentProcessorJobQueue = jobExecutorContext.getCurrentProcessorJobQueue(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
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); }
public void execute(CommandContext commandContext) { LOG.debugAddingNewExclusiveJobToJobExecutorCOntext(jobId); jobExecutorContext.getCurrentProcessorJobQueue().add(jobId); logExclusiveJobAdded(commandContext); }
jobExecutorContext.setCurrentJob(job); jobExecutorContext.setCurrentJob(null); identityService.clearAuthentication();
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); }
public void execute(CommandContext commandContext) { LOG.debugAddingNewExclusiveJobToJobExecutorCOntext(jobId); jobExecutorContext.getCurrentProcessorJobQueue().add(jobId); logExclusiveJobAdded(commandContext); }
jobExecutorContext.setCurrentJob(job); jobExecutorContext.setCurrentJob(null); identityService.clearAuthentication();
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); }
public void run() { final JobExecutorContext jobExecutorContext = new JobExecutorContext(); final List<String> currentProcessorJobQueue = jobExecutorContext.getCurrentProcessorJobQueue(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
public void execute(CommandContext commandContext) { LOG.debugAddingNewExclusiveJobToJobExecutorCOntext(jobId); jobExecutorContext.getCurrentProcessorJobQueue().add(jobId); logExclusiveJobAdded(commandContext); }
jobExecutorContext.setCurrentJob(job); jobExecutorContext.setCurrentJob(null); identityService.clearAuthentication();
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(); } } }
public void run() { final JobExecutorContext jobExecutorContext = new JobExecutorContext(); final List<String> currentProcessorJobQueue = jobExecutorContext.getCurrentProcessorJobQueue(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();