]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlow.java
Improve executions and system calls
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / DefaultExecutionFlow.java
index a1857a8c1482376dcf5b48378c66e35a2c7523d5..7425a35c93a1e94ff9a16d8c66e27d83b53fc517 100644 (file)
@@ -91,7 +91,7 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
        public void run() {
                try {
                        for (Runnable executable : executables) {
-                               executable.run();
+                               doExecuteRunnable(executable);
                        }
                } catch (RuntimeException e) {
                        if (failOnError)
@@ -100,13 +100,17 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                                log.error("Execution flow failed,"
                                                + " but process did not fail"
                                                + " because failOnError property"
-                                               + " is set to false: " + e, e);
+                                               + " is set to false: " + e);
                                if (log.isTraceEnabled())
                                        e.printStackTrace();
                        }
                }
        }
 
+       public void doExecuteRunnable(Runnable runnable) {
+               runnable.run();
+       }
+
        @SuppressWarnings(value = { "unchecked" })
        public void afterPropertiesSet() throws Exception {
                if (path != null) {
@@ -172,14 +176,21 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                                                .getAttributes().get(key).getValue() != null);
        }
 
+       @Override
        public String toString() {
-               return new StringBuffer("Flow ").append(name).toString();
+               return new StringBuffer("Execution flow ").append(name).toString();
        }
 
+       @Override
        public boolean equals(Object obj) {
                return ((ExecutionFlow) obj).getName().equals(name);
        }
 
+       @Override
+       public int hashCode() {
+               return name.hashCode();
+       }
+
        public String getPath() {
                return path;
        }