X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FInstantiationManager.java;h=c3d844c46c54c01bd267792e6ec1af8d23057d64;hb=9daa55ce316d52ffd8f30dc0d1b516ccf78a8c73;hp=6a5ee29c9027f1e0ce869f0bae50cee577642aed;hpb=51e7a445fccbf191d9bd420a76e652e20650411e;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java index 6a5ee29c9..c3d844c46 100644 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java +++ b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java @@ -15,23 +15,10 @@ public class InstantiationManager { public Object createRef(String name) { -// if((flowStack.get() == null) || flowStack.get().empty()) { -// throw new SlcException("No flow is currently initializing." -// + " Declare flow refs as inner beans or prototypes."); -// } -// -// /* -// * RefSpecAttribute refSpecAttribute = (RefSpecAttribute) attributes -// * .get(name); Class targetClass = refSpecAttribute.getTargetClass(); -// * ExecutionTargetSource targetSource = new ExecutionTargetSource(flow, -// * targetClass, name); ProxyFactory proxyFactory = new ProxyFactory(); -// * proxyFactory.setTargetClass(targetClass); -// * proxyFactory.setProxyTargetClass(true); -// * proxyFactory.setTargetSource(targetSource); -// * -// * return proxyFactory.getProxy(); -// */ -// return flowStack.get().peek().getParameter(name); + if((flowStack.get() == null) || flowStack.get().empty()) { + throw new SlcException("No flow is currently initializing." + + " Declare ParameterRef as inner beans or prototypes."); + } return getInitializingFlowParameter(name); } @@ -40,6 +27,12 @@ public class InstantiationManager { 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); + } + // log.info("# flowInitializationStarted " + flowName); // create a stack for this thread if there is none if(flowStack.get() == null) { @@ -72,9 +65,7 @@ public class InstantiationManager { } } throw new SlcException("Key " + key + " is not set as parameter in " - + flowStack.get().firstElement().toString()); - -// return flowStack.get().peek().getParameter(key); + + flowStack.get().firstElement().toString() + " (stack size="+flowStack.get().size()+")"); } public Boolean isInFlowInitialization() {