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=075a851dc8af90e99f7fc63b07041f637b92d27f;hb=5fcacdb600e4c9e765cb93b46132932662832c1b;hp=b42726dd44d553d27a35bf1222a1680bd3ed0c5d;hpb=0e2ff188c2e8ffac85739cccc3925e8bd82d7be9;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 b42726dd4..075a851dc 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 @@ -40,9 +40,16 @@ public class ExecutionThread extends Thread { } public void run() { + // authenticate thread +// Authentication authentication = getProcessThreadGroup() +// .getAuthentication(); +// if (authentication == null) +// throw new SlcException("Can only execute authenticated threads"); +// SecurityContextHolder.getContext().setAuthentication(authentication); + if (getContextClassLoader() != null) { if (log.isTraceEnabled()) - log.debug("Context class loader set to " + log.trace("Context class loader set to " + getContextClassLoader()); } @@ -51,8 +58,8 @@ public class ExecutionThread extends Thread { .getFlowDescriptor(); String flowName = executionFlowDescriptor.getName(); - dispatchAddStep(new ExecutionStep(ExecutionStep.PHASE_START, "Flow " - + flowName)); + dispatchAddStep(new ExecutionStep(realizedFlow.getModuleName(), + ExecutionStep.PHASE_START, "Flow " + flowName)); try { String autoUpgrade = System @@ -68,13 +75,13 @@ public class ExecutionThread extends Thread { // TODO: re-throw exception ? String msg = "Execution of flow " + flowName + " failed."; log.error(msg, e); - dispatchAddStep(new ExecutionStep(ExecutionStep.ERROR, msg + " " - + e.getMessage())); + dispatchAddStep(new ExecutionStep(realizedFlow.getModuleName(), + ExecutionStep.ERROR, msg + " " + e.getMessage())); processThread.notifyError(); } finally { processThread.flowCompleted(); - dispatchAddStep(new ExecutionStep(ExecutionStep.PHASE_END, "Flow " - + flowName)); + dispatchAddStep(new ExecutionStep(realizedFlow.getModuleName(), + ExecutionStep.PHASE_END, "Flow " + flowName)); } } @@ -82,4 +89,12 @@ public class ExecutionThread extends Thread { processThread.getProcessThreadGroup().dispatchAddStep(step); } + protected ProcessThreadGroup getProcessThreadGroup() { + return processThread.getProcessThreadGroup(); + } + + public RealizedFlow getRealizedFlow() { + return realizedFlow; + } + }