use of org.jbpm.runtime.manager.impl.tx.TransactionAwareSchedulerServiceInterceptor in project jbpm by kiegroup.
the class RuntimeManagerFactoryImpl method initTimerService.
protected void initTimerService(RuntimeEnvironment environment, RuntimeManager manager) {
if (environment instanceof SchedulerProvider) {
GlobalSchedulerService schedulerService = ((SchedulerProvider) environment).getSchedulerService();
if (schedulerService != null) {
TimerService globalTs = new GlobalTimerService(manager, schedulerService);
String timerServiceId = manager.getIdentifier() + TimerServiceRegistry.TIMER_SERVICE_SUFFIX;
// and register it in the registry under 'default' key
TimerServiceRegistry.getInstance().registerTimerService(timerServiceId, globalTs);
((SimpleRuntimeEnvironment) environment).addToConfiguration("drools.timerService", "new org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate(\"" + timerServiceId + "\")");
if (!schedulerService.isTransactional()) {
schedulerService.setInterceptor(new TransactionAwareSchedulerServiceInterceptor(environment, manager, schedulerService));
}
}
}
}
Aggregations