01: package org.jbpm.job.executor;
02:
03: import org.outerj.daisy.repository.Repository;
04: import org.outerj.daisy.repository.RepositoryManager;
05: import org.outerj.daisy.workflow.jbpm_util.Mailer;
06:
07: import javax.sql.DataSource;
08:
09: //
10: // Custom version of jBPM's JobExecutor in order to be able to start
11: // a custom version of the JobExecutorThread. See DaisyJobExecutorThread
12: // for more info.
13: //
14:
15: public class DaisyJobExecutor extends JobExecutor {
16: DataSource dataSource;
17: Repository repository;
18: RepositoryManager repositoryManager;
19: Mailer mailer;
20:
21: public void daisyInit(DataSource dataSource, Repository repository,
22: RepositoryManager repositoryManager, Mailer mailer) {
23: this .dataSource = dataSource;
24: this .repository = repository;
25: this .repositoryManager = repositoryManager;
26: this .mailer = mailer;
27: }
28:
29: @Override
30: protected synchronized void startThread() {
31: String threadName = getNextThreadName();
32: Thread thread = new DaisyJobExecutorThread(threadName, this ,
33: jbpmConfiguration, idleInterval, maxIdleInterval,
34: maxLockTime, historyMaxSize, dataSource, repository,
35: repositoryManager, mailer);
36: threads.put(threadName, thread);
37: // log.debug("starting new job executor thread '"+threadName+"'");
38: thread.start();
39: }
40:
41: }
|