X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fruntime%2FExecutionThread.java;h=7e0e7377852f67dc0da0514c9019c84de85d400f;hb=8ff996a3380166be2ae9cf0ef0fa22c58e11746a;hp=d940905f6aa022046eed302bfb4bfcb028b3ca22;hpb=6fc94d69efe089414ac9e63bde3efab1cbf7b7ca;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 d940905f6..7e0e73778 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,8 +12,6 @@ import java.util.List; import javax.security.auth.Subject; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.argeo.slc.execution.ExecutionFlowDescriptor; import org.argeo.slc.execution.ExecutionModulesManager; import org.argeo.slc.execution.ExecutionStep; @@ -20,7 +21,7 @@ import org.argeo.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 Log log = LogFactory.getLog(ExecutionThread.class); + private final static System.Logger logger = System.getLogger(ExecutionThread.class.getName()); private ExecutionModulesManager executionModulesManager; private final RealizedFlow realizedFlow; @@ -76,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 { @@ -97,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);