X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fruntime%2FExecutionThread.java;h=9e2f0681907007b7645a949c1d89c07929613afa;hb=09c9e5093fe1353aaac344ac8a8caf2e1dcc0778;hp=c5be2cf0a983b6031c3125bf2c340382e99deb6f;hpb=fbde11e8a342318876a4744c4676d3618bdf8583;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ExecutionThread.java b/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ExecutionThread.java index c5be2cf0a..9e2f06819 100644 --- a/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ExecutionThread.java +++ b/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ExecutionThread.java @@ -1,5 +1,8 @@ package org.argeo.slc.runtime; +import static java.lang.System.Logger.Level.ERROR; +import static java.lang.System.Logger.Level.WARNING; + import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedActionException; @@ -9,17 +12,16 @@ import java.util.List; import javax.security.auth.Subject; -import org.argeo.api.cms.CmsLog; -import org.argeo.slc.execution.ExecutionFlowDescriptor; -import org.argeo.slc.execution.ExecutionModulesManager; -import org.argeo.slc.execution.ExecutionStep; -import org.argeo.slc.execution.FlowConfigurationException; -import org.argeo.slc.execution.RealizedFlow; +import org.argeo.api.slc.execution.ExecutionFlowDescriptor; +import org.argeo.api.slc.execution.ExecutionModulesManager; +import org.argeo.api.slc.execution.ExecutionStep; +import org.argeo.api.slc.execution.FlowConfigurationException; +import org.argeo.api.slc.execution.RealizedFlow; /** Thread of a single execution */ public class ExecutionThread extends Thread { public final static String SYSPROP_EXECUTION_AUTO_UPGRADE = "slc.execution.autoupgrade"; - private final static CmsLog log = CmsLog.getLog(ExecutionThread.class); + private final static System.Logger logger = System.getLogger(ExecutionThread.class.getName()); private ExecutionModulesManager executionModulesManager; private final RealizedFlow realizedFlow; @@ -75,13 +77,13 @@ public class ExecutionThread extends Thread { } } catch (FlowConfigurationException e) { String msg = "Configuration problem with flow " + flowName + ":\n" + e.getMessage(); - log.error(msg); + logger.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."; - log.error(msg, e); + logger.log(ERROR, msg, e); getProcessThreadGroup().dispatchAddStep( new ExecutionStep(realizedFlow.getModuleName(), ExecutionStep.ERROR, msg + " " + e.getMessage())); } finally { @@ -96,14 +98,14 @@ public class ExecutionThread extends Thread { try { destructionCallbacks.get(i).run(); } catch (Exception e) { - log.warn("Could not process destruction callback " + i + " in thread " + getName(), e); + logger.log(WARNING, "Could not process destruction callback " + i + " in thread " + getName(), e); } } } /** - * Gather object destruction callback to be called in reverse order at the - * end of the thread + * Gather object destruction callback to be called in reverse order at the end + * of the thread */ public synchronized void registerDestructionCallback(String name, Runnable callback) { destructionCallbacks.add(callback);