protected RuntimeEngine findLocalRuntime(Object processInstanceId) { if (processInstanceId == null) { return null; } Map<Object, RuntimeEngine> map = local.get(); if (map == null) { return null; } else { RuntimeEngine engine = map.get(processInstanceId); // check if engine is not already disposed as afterCompletion might be issued from another thread if (engine != null && ((RuntimeEngineImpl) engine).isDisposed()) { map.remove(processInstanceId); return null; } return engine; } }
protected RuntimeEngine findLocalRuntime(Object caseId) { if (caseId == null) { return null; } Map<Object, RuntimeEngine> map = local.get(); if (map == null) { return null; } else { RuntimeEngine engine = map.get(caseId); // check if engine is not already disposed as afterCompletion might be issued from another thread if (engine != null && ((RuntimeEngineImpl) engine).isDisposed()) { map.remove(caseId); return null; } return engine; } }
RuntimeEngine engine = local.get().get(identifier); if (engine != null && ((RuntimeEngineImpl) engine).isDisposed()) { return null;
protected boolean canDispose(RuntimeEngine runtime) { // avoid duplicated dispose if (((RuntimeEngineImpl)runtime).isDisposed()) { return false; } // if this method was called as part of afterCompletion allow to dispose if (((RuntimeEngineImpl)runtime).isAfterCompletion()) { return true; } try { // check tx status to disallow dispose when within active transaction TransactionManager tm = getTransactionManager(runtime.getKieSession().getEnvironment()); if (tm.getStatus() != TransactionManager.STATUS_NO_TRANSACTION && tm.getStatus() != TransactionManager.STATUS_ROLLEDBACK && tm.getStatus() != TransactionManager.STATUS_COMMITTED) { return false; } } catch (SessionNotFoundException e) { // ignore it as it might be thrown for per process instance } return true; }
protected RuntimeEngine findLocalRuntime(Object processInstanceId) { if (processInstanceId == null) { return null; } Map<Object, RuntimeEngine> map = local.get(); if (map == null) { return null; } else { RuntimeEngine engine = map.get(processInstanceId); // check if engine is not already disposed as afterCompletion might be issued from another thread if (engine != null && ((RuntimeEngineImpl) engine).isDisposed()) { map.remove(processInstanceId); return null; } return engine; } }
protected RuntimeEngine findLocalRuntime(Object caseId) { if (caseId == null) { return null; } Map<Object, RuntimeEngine> map = local.get(); if (map == null) { return null; } else { RuntimeEngine engine = map.get(caseId); // check if engine is not already disposed as afterCompletion might be issued from another thread if (engine != null && ((RuntimeEngineImpl) engine).isDisposed()) { map.remove(caseId); return null; } return engine; } }
RuntimeEngine engine = local.get().get(identifier); if (engine != null && ((RuntimeEngineImpl) engine).isDisposed()) { return null;
protected boolean canDispose(RuntimeEngine runtime) { // avoid duplicated dispose if (((RuntimeEngineImpl)runtime).isDisposed()) { return false; } // if this method was called as part of afterCompletion allow to dispose if (((RuntimeEngineImpl)runtime).isAfterCompletion()) { return true; } try { // check tx status to disallow dispose when within active transaction TransactionManager tm = getTransactionManager(runtime.getKieSession().getEnvironment()); if (tm.getStatus() != TransactionManager.STATUS_NO_TRANSACTION && tm.getStatus() != TransactionManager.STATUS_ROLLEDBACK && tm.getStatus() != TransactionManager.STATUS_COMMITTED) { return false; } } catch (SessionNotFoundException e) { // ignore it as it might be thrown for per process instance } return true; }