X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fruntime%2FDefaultExecutionStack.java;h=b30d51788a8ac9be0b974002bb58aeedc08bbcfa;hb=8b6ef8eb76eb746509b2f48f1d927f532d0c986a;hp=9b5460bd995f8f9a1139fff110930147eba46663;hpb=6648f2e8438e06ea62343a9796107c580efe326b;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.runtime/src/org/argeo/slc/runtime/DefaultExecutionStack.java b/org.argeo.slc.runtime/src/org/argeo/slc/runtime/DefaultExecutionStack.java index 9b5460bd9..b30d51788 100644 --- a/org.argeo.slc.runtime/src/org/argeo/slc/runtime/DefaultExecutionStack.java +++ b/org.argeo.slc.runtime/src/org/argeo/slc/runtime/DefaultExecutionStack.java @@ -5,7 +5,6 @@ import java.util.Map; import java.util.Stack; import java.util.UUID; -import org.argeo.api.cms.CmsLog; import org.argeo.slc.SlcException; import org.argeo.slc.execution.ExecutionFlow; import org.argeo.slc.execution.ExecutionSpecAttribute; @@ -13,22 +12,16 @@ import org.argeo.slc.execution.ExecutionStack; /** Canonical implementation of an execution stack. */ public class DefaultExecutionStack implements ExecutionStack { - - private final static CmsLog log = CmsLog - .getLog(DefaultExecutionStack.class); - private final Stack stack = new Stack(); public synchronized void enterFlow(ExecutionFlow executionFlow) { ExecutionFlowRuntime runtime = new ExecutionFlowRuntime(executionFlow); stack.push(runtime); - Map specAttrs = executionFlow - .getExecutionSpec().getAttributes(); + Map specAttrs = executionFlow.getExecutionSpec().getAttributes(); for (String key : specAttrs.keySet()) { if (executionFlow.isSetAsParameter(key)) { - runtime.getLocalVariables().put(key, - executionFlow.getParameter(key)); + runtime.getLocalVariables().put(key, executionFlow.getParameter(key)); } } } @@ -60,10 +53,8 @@ public class DefaultExecutionStack implements ExecutionStack { public synchronized void leaveFlow(ExecutionFlow executionFlow) { ExecutionFlowRuntime leftEf = stack.pop(); - if (!leftEf.getExecutionFlow().getName() - .equals(executionFlow.getName())) - throw new SlcException("Asked to leave " + executionFlow - + " but last is " + leftEf); + if (!leftEf.getExecutionFlow().getName().equals(executionFlow.getName())) + throw new SlcException("Asked to leave " + executionFlow + " but last is " + leftEf); leftEf.getScopedObjects().clear(); leftEf.getLocalVariables().clear(); @@ -72,12 +63,12 @@ public class DefaultExecutionStack implements ExecutionStack { public synchronized void addScopedObject(String name, Object obj) { ExecutionFlowRuntime runtime = stack.peek(); // TODO: check that the object is not set yet ? - if (log.isDebugEnabled()) { - Object existing = findScopedObject(name); - if (existing != null) - log.warn("Scoped object " + name + " of type " + obj.getClass() - + " already registered in " + runtime); - } +// if (log.isDebugEnabled()) { +// Object existing = findScopedObject(name); +// if (existing != null) +// log.warn("Scoped object " + name + " of type " + obj.getClass() +// + " already registered in " + runtime); +// } runtime.getScopedObjects().put(name, obj); }