public RuntimeEnvironmentBuilder schedulerService(Object globalScheduler) { if (globalScheduler == null) { return this; } if (!(globalScheduler instanceof GlobalSchedulerService)) { throw new IllegalArgumentException("Argument is not of type GlobalSchedulerService"); } this.runtimeEnvironment.setSchedulerService((GlobalSchedulerService) globalScheduler); return this; }
public RuntimeEnvironmentBuilder schedulerService(Object globalScheduler) { if (globalScheduler == null) { return this; } if (!(globalScheduler instanceof GlobalSchedulerService)) { throw new IllegalArgumentException("Argument is not of type GlobalSchedulerService"); } this.runtimeEnvironment.setSchedulerService((GlobalSchedulerService) globalScheduler); return this; }
/** * Sets the schedulerService. * @param globalScheduler schedulerService * @return this RuntimeEnvironmentBuilder */ public RuntimeEnvironmentBuilder schedulerService(Object globalScheduler) { if (globalScheduler == null) { return this; } if (!(globalScheduler instanceof GlobalSchedulerService)) { throw new IllegalArgumentException("Argument is not of type GlobalSchedulerService"); } _runtimeEnvironment.setSchedulerService((GlobalSchedulerService) globalScheduler); return this; }
/** * Sets the schedulerService. * @param globalScheduler schedulerService * @return this RuntimeEnvironmentBuilder */ public RuntimeEnvironmentBuilder schedulerService(Object globalScheduler) { if (globalScheduler == null) { return this; } if (!(globalScheduler instanceof GlobalSchedulerService)) { throw new IllegalArgumentException("Argument is not of type GlobalSchedulerService"); } _runtimeEnvironment.setSchedulerService((GlobalSchedulerService) globalScheduler); return this; }
protected void adjustEnvironment(RuntimeEnvironment environment) { if (userGroupCallback != null) { ((SimpleRuntimeEnvironment)environment).setUserGroupCallback(userGroupCallback); } if (schedulerService != null) { ((SimpleRuntimeEnvironment)environment).setSchedulerService(schedulerService); } ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.TRANSACTION_MANAGER, transactionManager); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.TASK_USER_GROUP_CALLBACK, userGroupCallback); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.TASK_USER_INFO, userInfo); if (entityManager != null) { ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.APP_SCOPED_ENTITY_MANAGER, entityManager); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER, entityManager); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set("IS_JTA_TRANSACTION", false); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set("IS_SHARED_ENTITY_MANAGER", true); } if (pessimisticLocking) { ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.USE_PESSIMISTIC_LOCKING, true); } TransactionManagerFactory transactionManagerFactory = TransactionManagerFactory.get(); if (transactionManagerFactory instanceof KieSpringTransactionManagerFactory) { ((KieSpringTransactionManagerFactory) transactionManagerFactory).setGlobalTransactionManager(transactionManager); } }
protected void adjustEnvironment(RuntimeEnvironment environment) { if (userGroupCallback != null) { ((SimpleRuntimeEnvironment)environment).setUserGroupCallback(userGroupCallback); } if (schedulerService != null) { ((SimpleRuntimeEnvironment)environment).setSchedulerService(schedulerService); } ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.TRANSACTION_MANAGER, transactionManager); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.TASK_USER_GROUP_CALLBACK, userGroupCallback); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.TASK_USER_INFO, userInfo); if (entityManager != null) { ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.APP_SCOPED_ENTITY_MANAGER, entityManager); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER, entityManager); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set("IS_JTA_TRANSACTION", false); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set("IS_SHARED_ENTITY_MANAGER", true); } if (pessimisticLocking) { ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.USE_PESSIMISTIC_LOCKING, true); } TransactionManagerFactory transactionManagerFactory = TransactionManagerFactory.get(); if (transactionManagerFactory instanceof KieSpringTransactionManagerFactory) { ((KieSpringTransactionManagerFactory) transactionManagerFactory).setGlobalTransactionManager(transactionManager); } }