Search in sources :

Example 1 with ClassCacheManager

use of org.jbpm.executor.impl.ClassCacheManager 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;
}
Also used : AvailableJobsExecutor(org.jbpm.executor.impl.AvailableJobsExecutor) ClassCacheManager(org.jbpm.executor.impl.ClassCacheManager) AvailableJobsExecutor(org.jbpm.executor.impl.AvailableJobsExecutor) Executor(org.kie.api.executor.Executor) ExecutorAdminService(org.kie.api.executor.ExecutorAdminService) ExecutorRequestAdminServiceImpl(org.jbpm.executor.impl.jpa.ExecutorRequestAdminServiceImpl) ExecutorServiceImpl(org.jbpm.executor.impl.ExecutorServiceImpl) ExecutorStoreService(org.kie.api.executor.ExecutorStoreService) JPAExecutorStoreService(org.jbpm.executor.impl.jpa.JPAExecutorStoreService) ExecutorImpl(org.jbpm.executor.impl.ExecutorImpl) JPAExecutorStoreService(org.jbpm.executor.impl.jpa.JPAExecutorStoreService) ExecutorService(org.kie.api.executor.ExecutorService) ExecutorQueryServiceImpl(org.jbpm.executor.impl.jpa.ExecutorQueryServiceImpl) ExecutorQueryService(org.kie.api.executor.ExecutorQueryService)

Aggregations

AvailableJobsExecutor (org.jbpm.executor.impl.AvailableJobsExecutor)1 ClassCacheManager (org.jbpm.executor.impl.ClassCacheManager)1 ExecutorImpl (org.jbpm.executor.impl.ExecutorImpl)1 ExecutorServiceImpl (org.jbpm.executor.impl.ExecutorServiceImpl)1 ExecutorQueryServiceImpl (org.jbpm.executor.impl.jpa.ExecutorQueryServiceImpl)1 ExecutorRequestAdminServiceImpl (org.jbpm.executor.impl.jpa.ExecutorRequestAdminServiceImpl)1 JPAExecutorStoreService (org.jbpm.executor.impl.jpa.JPAExecutorStoreService)1 Executor (org.kie.api.executor.Executor)1 ExecutorAdminService (org.kie.api.executor.ExecutorAdminService)1 ExecutorQueryService (org.kie.api.executor.ExecutorQueryService)1 ExecutorService (org.kie.api.executor.ExecutorService)1 ExecutorStoreService (org.kie.api.executor.ExecutorStoreService)1