]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/InstantiationManager.java
Fix SVN issues
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.simple / src / main / java / org / argeo / slc / core / execution / InstantiationManager.java
index 6a5ee29c9027f1e0ce869f0bae50cee577642aed..c3d844c46c54c01bd267792e6ec1af8d23057d64 100644 (file)
@@ -15,23 +15,10 @@ public class InstantiationManager {
        \r
        public Object createRef(String name) {\r
                \r
-//             if((flowStack.get() == null) ||  flowStack.get().empty()) {\r
-//                     throw new SlcException("No flow is currently initializing."\r
-//                                     + " Declare flow refs as inner beans or prototypes.");\r
-//             }\r
-//\r
-//             /*\r
-//              * RefSpecAttribute refSpecAttribute = (RefSpecAttribute) attributes\r
-//              * .get(name); Class<?> targetClass = refSpecAttribute.getTargetClass();\r
-//              * ExecutionTargetSource targetSource = new ExecutionTargetSource(flow,\r
-//              * targetClass, name); ProxyFactory proxyFactory = new ProxyFactory();\r
-//              * proxyFactory.setTargetClass(targetClass);\r
-//              * proxyFactory.setProxyTargetClass(true);\r
-//              * proxyFactory.setTargetSource(targetSource);\r
-//              * \r
-//              * return proxyFactory.getProxy();\r
-//              */\r
-//             return flowStack.get().peek().getParameter(name);\r
+               if((flowStack.get() == null) ||  flowStack.get().empty()) {\r
+                       throw new SlcException("No flow is currently initializing."\r
+                                       + " Declare ParameterRef as inner beans or prototypes.");\r
+               }\r
                \r
                return getInitializingFlowParameter(name);\r
        }       \r
@@ -40,6 +27,12 @@ public class InstantiationManager {
                if (log.isTraceEnabled())\r
                        log.trace("Start initialization of " + flow.hashCode() + " ("\r
                                        + flow + " - " + flow.getClass() + ")");\r
+               \r
+               // set the flow name if it is DefaultExecutionFlow\r
+               if(flow instanceof DefaultExecutionFlow) {\r
+                       ((DefaultExecutionFlow) flow).setBeanName(flowName);\r
+               }\r
+               \r
 //             log.info("# flowInitializationStarted " + flowName);\r
                // create a stack for this thread if there is none\r
                if(flowStack.get() == null) {\r
@@ -72,9 +65,7 @@ public class InstantiationManager {
                        }\r
                }\r
                throw new SlcException("Key " + key + " is not set as parameter in "\r
-                               + flowStack.get().firstElement().toString());\r
-               \r
-//             return flowStack.get().peek().getParameter(key);\r
+                               + flowStack.get().firstElement().toString() + " (stack size="+flowStack.get().size()+")");              \r
        }\r
 \r
        public Boolean isInFlowInitialization() {\r