Search in sources :

Example 1 with JobProcessorImpl

use of org.wso2.carbon.humantask.core.scheduler.JobProcessorImpl in project carbon-business-process by wso2.

the class HumanTaskServer method initScheduler.

/**
 * Scheduler initialisation.
 */
private void initScheduler() {
    ThreadFactory threadFactory = new ThreadFactory() {

        private int threadNumber = 0;

        public Thread newThread(Runnable r) {
            threadNumber += 1;
            Thread t = new Thread(r, "HumanTaskServer-" + threadNumber);
            t.setDaemon(true);
            return t;
        }
    };
    ExecutorService executorService = Executors.newFixedThreadPool(serverConfig.getThreadPoolMaxSize(), threadFactory);
    SimpleScheduler simpleScheduler = new SimpleScheduler(new GUID().toString());
    simpleScheduler.setExecutorService(executorService);
    simpleScheduler.setTransactionManager(tnxManager);
    taskEngine.setScheduler(simpleScheduler);
    simpleScheduler.setJobProcessor(new JobProcessorImpl());
    // Start the scheduler within the HumanTaskSchedulerInitializer to ensure that all the tasks are deployed
    // when the scheduler actually starts.
    // simpleScheduler.start();
    scheduler = simpleScheduler;
}
Also used : ThreadFactory(java.util.concurrent.ThreadFactory) ExecutorService(java.util.concurrent.ExecutorService) GUID(org.wso2.carbon.humantask.core.utils.GUID) SimpleScheduler(org.wso2.carbon.humantask.core.scheduler.SimpleScheduler) JobProcessorImpl(org.wso2.carbon.humantask.core.scheduler.JobProcessorImpl)

Aggregations

ExecutorService (java.util.concurrent.ExecutorService)1 ThreadFactory (java.util.concurrent.ThreadFactory)1 JobProcessorImpl (org.wso2.carbon.humantask.core.scheduler.JobProcessorImpl)1 SimpleScheduler (org.wso2.carbon.humantask.core.scheduler.SimpleScheduler)1 GUID (org.wso2.carbon.humantask.core.utils.GUID)1