use of org.jbpm.executor.impl.ExecutorImpl in project jbpm by kiegroup.
the class ExecutorServiceEJBImpl method init.
@PostConstruct
@Override
public void init() {
ExecutorImpl executor = new ExecutorImpl();
executor.setExecutorStoreService(this.storeService);
executor.setEventSupport(getEventSupport());
executor.setTransactionManager(this.transactionalCommandService.getTransactionManager());
AvailableJobsExecutor jobExecutor = new AvailableJobsExecutor();
jobExecutor.setClassCacheManager(this.classCacheManager);
jobExecutor.setQueryService(getQueryService());
jobExecutor.setExecutorStoreService(this.storeService);
jobExecutor.setEventSupport(getEventSupport());
jobExecutor.setExecutor(executor);
executor.setJobProcessor(jobExecutor);
setExecutor(executor);
super.init();
}
use of org.jbpm.executor.impl.ExecutorImpl in project jbpm by kiegroup.
the class ExecutorServiceFactory method configure.
private static ExecutorService configure(EntityManagerFactory emf, TransactionalCommandService commandService, ExecutorEventSupportImpl eventSupport) {
// create instances of executor services
ExecutorQueryService queryService = new ExecutorQueryServiceImpl(true);
Executor executor = new ExecutorImpl();
ExecutorAdminService adminService = new ExecutorRequestAdminServiceImpl();
ExecutorStoreService storeService = new JPAExecutorStoreService(true);
((JPAExecutorStoreService) storeService).setCommandService(commandService);
((JPAExecutorStoreService) storeService).setEmf(emf);
((JPAExecutorStoreService) storeService).setEventSupport(eventSupport);
AvailableJobsExecutor jobExecutor = new AvailableJobsExecutor();
ClassCacheManager classCacheManager = new ClassCacheManager();
jobExecutor.setClassCacheManager(classCacheManager);
jobExecutor.setQueryService(queryService);
jobExecutor.setExecutorStoreService(storeService);
jobExecutor.setEventSupport(eventSupport);
jobExecutor.setExecutor(executor);
((ExecutorImpl) executor).setExecutorStoreService(storeService);
((ExecutorImpl) executor).setEventSupport(eventSupport);
((ExecutorImpl) executor).setJobProcessor(jobExecutor);
((ExecutorImpl) executor).setTransactionManager(commandService.getTransactionManager());
// set executor on all instances that requires it
((ExecutorQueryServiceImpl) queryService).setCommandService(commandService);
((ExecutorRequestAdminServiceImpl) adminService).setCommandService(commandService);
((ExecutorRequestAdminServiceImpl) adminService).setExecutor(executor);
// configure services
ExecutorService service = new ExecutorServiceImpl(executor);
((ExecutorServiceImpl) service).setQueryService(queryService);
((ExecutorServiceImpl) service).setExecutor(executor);
((ExecutorServiceImpl) service).setAdminService(adminService);
((ExecutorServiceImpl) service).setEventSupport(eventSupport);
return service;
}
Aggregations