]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlow.java
Revert to Equinox v3.4.2
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / DefaultExecutionFlow.java
index 497e6520e86177a7b1bf79748b1f1bb11298fb33..a25034e347a3e4dee381b9a2f0819102e91212f7 100644 (file)
@@ -15,13 +15,10 @@ import org.argeo.slc.structure.StructureAware;
 import org.argeo.slc.structure.StructureRegistry;
 import org.springframework.beans.factory.BeanNameAware;
 import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.ResourceLoaderAware;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.ResourceLoader;
 import org.springframework.validation.MapBindingResult;
 
 public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
-               BeanNameAware, StructureAware<TreeSPath>, ResourceLoaderAware {
+               BeanNameAware {
 
        private final ExecutionSpec executionSpec;
        private String name = null;
@@ -31,8 +28,6 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
        private String path;
        private StructureRegistry<TreeSPath> registry = new TreeSRegistry();
 
-       private ResourceLoader resourceLoader = null;
-
        public DefaultExecutionFlow() {
                this.executionSpec = new DefaultExecutionSpec();
        }
@@ -93,12 +88,18 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                }
        }
 
+       @SuppressWarnings(value = { "unchecked" })
        public void afterPropertiesSet() throws Exception {
                if (path != null) {
                        for (Runnable executable : executables) {
                                if (executable instanceof StructureAware) {
                                        ((StructureAware<TreeSPath>) executable).notifyCurrentPath(
                                                        registry, new TreeSPath(path));
+                               } else if (executable instanceof DefaultExecutionFlow) {
+                                       // so we don't need to have DefaultExecutionFlow
+                                       // implementing StructureAware
+                                       DefaultExecutionFlow flow = (DefaultExecutionFlow) executable;
+                                       flow.setPath(path + '/' + flow.getName());
                                }
                        }
                }
@@ -172,15 +173,4 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                this.registry = registry;
        }
 
-       public void notifyCurrentPath(StructureRegistry<TreeSPath> registry,
-                       TreeSPath path) {
-               if (this.path == null) {
-                       this.path = path.toString();
-               }
-       }
-
-       public void setResourceLoader(ResourceLoader resourceLoader) {
-               this.resourceLoader = resourceLoader;
-       }
-
 }