protected void removeRuntimeFromTaskService() { TaskContentRegistry.get().removeMarshallerContext(getIdentifier()); } /**
protected void attachManager(RuntimeEngine runtime) { runtime.getKieSession().getEnvironment().set(EnvironmentName.RUNTIME_MANAGER, this); runtime.getKieSession().getEnvironment().set(EnvironmentName.DEPLOYMENT_ID, this.getIdentifier()); }
public void close(boolean removeJobs) { cacheManager.dispose(); environment.close(); registry.remove(identifier); TimerService timerService = TimerServiceRegistry.getInstance().get(getIdentifier() + TimerServiceRegistry.TIMER_SERVICE_SUFFIX); if (timerService != null) { try { if (removeJobs && timerService instanceof GlobalTimerService) { ((GlobalTimerService) timerService).destroy(); } timerService.shutdown(); GlobalSchedulerService schedulerService = ((SchedulerProvider) environment).getSchedulerService(); if (schedulerService != null) { schedulerService.shutdown(); } } finally { TimerServiceRegistry.getInstance().remove(getIdentifier() + TimerServiceRegistry.TIMER_SERVICE_SUFFIX); } } this.closed = true; }
protected InternalTaskService newTaskService(TaskServiceFactory factory) { InternalTaskService internalTaskService = (InternalTaskService) factory.newTaskService(); if (internalTaskService instanceof CommandBasedTaskService) { ((CommandBasedTaskService) internalTaskService).getEnvironment().set(EnvironmentName.DEPLOYMENT_ID, this.getIdentifier()); ((CommandBasedTaskService) internalTaskService).getEnvironment().set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES, ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES)); } return internalTaskService; }
public AbstractRuntimeManager(RuntimeEnvironment environment, String identifier) { this.environment = environment; this.identifier = identifier; if (registry.isRegistered(identifier)) { throw new IllegalStateException("RuntimeManager with id " + identifier + " is already active"); } ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.DEPLOYMENT_ID, this.getIdentifier()); internalSetDeploymentDescriptor(); internalSetKieContainer(); ((InternalRegisterableItemsFactory)environment.getRegisterableItemsFactory()).setRuntimeManager(this); String eagerInit = (String)((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().get("RuntimeEngineEagerInit"); if (eagerInit != null) { engineInitEager = Boolean.parseBoolean(eagerInit); } ExecutionErrorStorage storage = (ExecutionErrorStorage) ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().get("ExecutionErrorStorage"); if (storage == null) { storage = new DefaultExecutionErrorStorage(environment.getEnvironment()); } this.executionErrorManager = new ExecutionErrorManagerImpl(storage); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.EXEC_ERROR_MANAGER, executionErrorManager); }
protected void removeRuntimeFromTaskService() { TaskContentRegistry.get().removeMarshallerContext(getIdentifier()); } /**
protected void attachManager(RuntimeEngine runtime) { runtime.getKieSession().getEnvironment().set(EnvironmentName.RUNTIME_MANAGER, this); runtime.getKieSession().getEnvironment().set(EnvironmentName.DEPLOYMENT_ID, this.getIdentifier()); }
protected InternalTaskService newTaskService(TaskServiceFactory factory) { InternalTaskService internalTaskService = (InternalTaskService) factory.newTaskService(); if (internalTaskService instanceof CommandBasedTaskService) { ((CommandBasedTaskService) internalTaskService).getEnvironment().set(EnvironmentName.DEPLOYMENT_ID, this.getIdentifier()); ((CommandBasedTaskService) internalTaskService).getEnvironment().set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES, ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES)); } return internalTaskService; }
public void close(boolean removeJobs) { cacheManager.dispose(); environment.close(); registry.remove(identifier); TimerService timerService = TimerServiceRegistry.getInstance().get(getIdentifier() + TimerServiceRegistry.TIMER_SERVICE_SUFFIX); if (timerService != null) { try { if (removeJobs && timerService instanceof GlobalTimerService) { ((GlobalTimerService) timerService).destroy(); } timerService.shutdown(); GlobalSchedulerService schedulerService = ((SchedulerProvider) environment).getSchedulerService(); if (schedulerService != null) { schedulerService.shutdown(); } } finally { TimerServiceRegistry.getInstance().remove(getIdentifier() + TimerServiceRegistry.TIMER_SERVICE_SUFFIX); } } this.closed = true; }
public AbstractRuntimeManager(RuntimeEnvironment environment, String identifier) { this.environment = environment; this.identifier = identifier; if (registry.isRegistered(identifier)) { throw new IllegalStateException("RuntimeManager with id " + identifier + " is already active"); } ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.DEPLOYMENT_ID, this.getIdentifier()); internalSetDeploymentDescriptor(); internalSetKieContainer(); ((InternalRegisterableItemsFactory)environment.getRegisterableItemsFactory()).setRuntimeManager(this); String eagerInit = (String)((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().get("RuntimeEngineEagerInit"); if (eagerInit != null) { engineInitEager = Boolean.parseBoolean(eagerInit); } ExecutionErrorStorage storage = (ExecutionErrorStorage) ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().get("ExecutionErrorStorage"); if (storage == null) { storage = new DefaultExecutionErrorStorage(environment.getEnvironment()); } this.executionErrorManager = new ExecutionErrorManagerImpl(storage); ((SimpleRuntimeEnvironment)environment).getEnvironmentTemplate().set(EnvironmentName.EXEC_ERROR_MANAGER, executionErrorManager); }