X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FExecutionThread.java;h=9289c7f56f03acd98c8b3921775aa850a474fa88;hb=6de9c4036be9e318f59a0ffa187570f5999c53cb;hp=6a1c9728465aeeed4a4ff60cdc3a77ef4ea28184;hpb=a17824ea2422474f25e2ea0eeae310f4dd9e6361;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionThread.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionThread.java index 6a1c97284..9289c7f56 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionThread.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionThread.java @@ -31,12 +31,10 @@ import org.springframework.security.context.SecurityContextHolder; /** Thread of a single execution */ public class ExecutionThread extends Thread { public final static String SYSPROP_EXECUTION_AUTO_UPGRADE = "slc.execution.autoupgrade"; - private final static Log log = LogFactory.getLog(ExecutionThread.class); private ExecutionModulesManager executionModulesManager; private final RealizedFlow realizedFlow; - // private final ProcessThread processThread; private List destructionCallbacks = new ArrayList(); @@ -47,7 +45,6 @@ public class ExecutionThread extends Thread { + realizedFlow.getFlowDescriptor().getName()); this.realizedFlow = realizedFlow; this.executionModulesManager = executionModulesManager; - // this.processThread = processThread; } public void run() { @@ -73,11 +70,19 @@ public class ExecutionThread extends Thread { if (autoUpgrade != null && autoUpgrade.equals("true")) executionModulesManager.upgrade(realizedFlow .getModuleNameVersion()); - executionModulesManager.start(realizedFlow.getModuleNameVersion()); + // // START FLOW + // executionModulesManager.execute(realizedFlow); // END FLOW + } catch (FlowConfigurationException e) { + String msg = "Configuration problem with flow " + flowName + ":\n" + + e.getMessage(); + log.error(msg); + getProcessThreadGroup().dispatchAddStep( + new ExecutionStep(realizedFlow.getModuleName(), + ExecutionStep.ERROR, msg + " " + e.getMessage())); } catch (Exception e) { // TODO: re-throw exception ? String msg = "Execution of flow " + flowName + " failed."; @@ -85,9 +90,7 @@ public class ExecutionThread extends Thread { getProcessThreadGroup().dispatchAddStep( new ExecutionStep(realizedFlow.getModuleName(), ExecutionStep.ERROR, msg + " " + e.getMessage())); - // processThread.notifyError(); } finally { - // processThread.flowCompleted(); getProcessThreadGroup().dispatchAddStep( new ExecutionStep(realizedFlow.getModuleName(), ExecutionStep.PHASE_END, "Flow " + flowName)); @@ -95,10 +98,6 @@ public class ExecutionThread extends Thread { } } - // private void dispatchAddStep(ExecutionStep step) { - // getProcessThreadGroup().dispatchAddStep(step); - // } - private synchronized void processDestructionCallbacks() { for (int i = destructionCallbacks.size() - 1; i >= 0; i--) { try { @@ -120,11 +119,5 @@ public class ExecutionThread extends Thread { protected ProcessThreadGroup getProcessThreadGroup() { return (ProcessThreadGroup) getThreadGroup(); - // return processThread.getProcessThreadGroup(); } - - // public RealizedFlow getRealizedFlow() { - // return realizedFlow; - // } - -} +} \ No newline at end of file