public void init() { String location = getLocation(); Long knownSessionId = getPersistedSessionId(location, identifier); InternalTaskService internalTaskService = newTaskService(taskServiceFactory); tm = getTransactionManagerInternal(environment.getEnvironment()); owner = tm.begin(); persistSessionId(location, identifier, singleton.getKieSession().getIdentifier()); TaskContentRegistry.get().addMarshallerContext(getIdentifier(), new ContentMarshallerContext(environment.getEnvironment(), environment.getClassLoader())); configureRuntimeOnTaskService(internalTaskService, singleton); registerItems(this.singleton); attachManager(this.singleton); this.registry.register(this); if (tm != null) {
@SuppressWarnings("rawtypes") @Override public RuntimeEngine getRuntimeEngine(Context context) { if (isClosed()) { throw new IllegalStateException("Runtime manager " + identifier + " is already closed"); } checkPermission(); // always return the same instance return this.singleton; }
@Override public RuntimeManager newSingletonRuntimeManager(RuntimeEnvironment environment, String identifier) { SessionFactory factory = getSessionFactory(environment, identifier); TaskServiceFactory taskServiceFactory = getTaskServiceFactory(environment); RuntimeManager manager = new SingletonRuntimeManager(environment, factory, taskServiceFactory, identifier); initTimerService(environment, manager); ((AbstractRuntimeManager) manager).init(); return manager; }
@Override public void validate(KieSession ksession, Context<?> context) throws IllegalStateException { if (isClosed()) { throw new IllegalStateException("Runtime manager " + identifier + " is already closed"); } if (this.singleton != null && this.singleton.getKieSession().getIdentifier() != ksession.getIdentifier()) { throw new IllegalStateException("Invalid session was used for this context " + context); } }
@Override public RuntimeManager newSingletonRuntimeManager(RuntimeEnvironment environment, String identifier) { SessionFactory factory = getSessionFactory(environment, identifier); TaskServiceFactory taskServiceFactory = getTaskServiceFactory(environment); RuntimeManager manager = new SingletonRuntimeManager(environment, factory, taskServiceFactory, identifier); initTimerService(environment, manager); ((AbstractRuntimeManager) manager).init(); return manager; }
@Override public void validate(KieSession ksession, Context<?> context) throws IllegalStateException { if (isClosed()) { throw new IllegalStateException("Runtime manager " + identifier + " is already closed"); } if (this.singleton != null && this.singleton.getKieSession().getIdentifier() != ksession.getIdentifier()) { throw new IllegalStateException("Invalid session was used for this context " + context); } }
public void init() { String location = getLocation(); Long knownSessionId = getPersistedSessionId(location, identifier); InternalTaskService internalTaskService = newTaskService(taskServiceFactory); tm = getTransactionManagerInternal(environment.getEnvironment()); owner = tm.begin(); persistSessionId(location, identifier, singleton.getKieSession().getIdentifier()); TaskContentRegistry.get().addMarshallerContext(getIdentifier(), new ContentMarshallerContext(environment.getEnvironment(), environment.getClassLoader())); configureRuntimeOnTaskService(internalTaskService, singleton); registerItems(this.singleton); attachManager(this.singleton); this.registry.register(this); if (tm != null) {
@Override public void signalEvent(String type, Object event) { if (isClosed()) { throw new IllegalStateException("Runtime manager " + identifier + " is already closed"); } checkPermission(); this.singleton.getKieSession().signalEvent(type, event); }
@SuppressWarnings("rawtypes") @Override public RuntimeEngine getRuntimeEngine(Context context) { if (isClosed()) { throw new IllegalStateException("Runtime manager " + identifier + " is already closed"); } checkPermission(); // always return the same instance return this.singleton; }
@Override public void signalEvent(String type, Object event) { if (isClosed()) { throw new IllegalStateException("Runtime manager " + identifier + " is already closed"); } checkPermission(); this.singleton.getKieSession().signalEvent(type, event); }