public RuntimeEnvironmentBuilder addConfiguration(String name, String value) { if (name == null || value == null) { return this; } this.runtimeEnvironment.addToConfiguration(name, value); return this; }
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)); } } } }
public RuntimeEnvironmentBuilder addConfiguration(String name, String value) { if (name == null || value == null) { return this; } this.runtimeEnvironment.addToConfiguration(name, value); return this; }
/** * Adds a configuration name/value pair. * @param name name * @param value value * @return this RuntimeEnvironmentBuilder */ public RuntimeEnvironmentBuilder addConfiguration(String name, String value) { if (name == null || value == null) { return this; } _runtimeEnvironment.addToConfiguration(name, value); return this; }
/** * Adds a configuration name/value pair. * @param name name * @param value value * @return this RuntimeEnvironmentBuilder */ public RuntimeEnvironmentBuilder addConfiguration(String name, String value) { if (name == null || value == null) { return this; } _runtimeEnvironment.addToConfiguration(name, value); return this; }
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)); } } } }
/** * This code takes care of configuring the runtime environment to configure the timer service * (an internal component of the KIE Session used to measure how time progresses, used * for signals and time based rules). It will create a specific timer service, separate from any * other, exclusively for the new runitme manager, and if the configuration makes it a transactional * object, it adds an interceptor to the timer service to store scheduled tasks in the database as well. */ 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, schedulerService)); } } } } }