X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FInstantiationManager.java;h=c3692a55026dffab43ca0dc3dfc6eceff6191c10;hb=f41c54f9803f2617287cec0515e140f22687fac9;hp=eb6ce53473407a258fb5f1a6af52401be5201eb8;hpb=2fc453bcd60b20071d878d6f1249592c8572de16;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java index eb6ce5347..c3692a550 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java @@ -26,14 +26,14 @@ public class InstantiationManager { } public void flowInitializationStarted(ExecutionFlow flow, String flowName) { - if (log.isTraceEnabled()) - log.trace("Start initialization of " + flow.hashCode() + " (" - + flow + " - " + flow.getClass() + ")"); - // set the flow name if it is DefaultExecutionFlow if (flow instanceof DefaultExecutionFlow) { ((DefaultExecutionFlow) flow).setBeanName(flowName); } + + if (log.isTraceEnabled()) + log.trace("Start initialization of " + flow.hashCode() + " (" + + flow + " - " + flow.getClass() + ")"); // log.info("# flowInitializationStarted " + flowName); // create a stack for this thread if there is none @@ -47,12 +47,19 @@ public class InstantiationManager { if (log.isTraceEnabled()) log.trace("Finish initialization of " + flow.hashCode() + " (" + flow + " - " + flow.getClass() + ")"); - ExecutionFlow registeredFlow = flowStack.get().pop(); - if (registeredFlow != null) { - if (!flow.getName().equals(registeredFlow.getName())) - throw new SlcException("Current flow is " + flow); - // log.info("# flowInitializationFinished " + flowName); - // initializingFlow.set(null); + + if(flowStack.get() != null) { + ExecutionFlow registeredFlow = flowStack.get().pop(); + if (registeredFlow != null) { + if (!flow.getName().equals(registeredFlow.getName())) + throw new SlcException("Current flow is " + flow); + // log.info("# flowInitializationFinished " + flowName); + // initializingFlow.set(null); + } + } + else { + // happens for flows imported as services + log.warn("flowInitializationFinished - Flow Stack is null"); } }