X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fruntime%2FProcessThread.java;h=1bbf9d12857a3bb554491aff8625125aa8e8f008;hb=8596685647867307b862b8a89742b6a62ba75fcd;hp=97f83e2f947bfb7ffa4a38ba3848a6fb6813a5c1;hpb=fbde11e8a342318876a4744c4676d3618bdf8583;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ProcessThread.java b/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ProcessThread.java index 97f83e2f9..1bbf9d128 100644 --- a/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ProcessThread.java +++ b/org.argeo.slc.runtime/src/org/argeo/slc/runtime/ProcessThread.java @@ -1,5 +1,6 @@ package org.argeo.slc.runtime; +import java.lang.System.Logger.Level; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedActionException; @@ -12,7 +13,6 @@ import java.util.Set; import javax.security.auth.Subject; -import org.argeo.api.cms.CmsLog; import org.argeo.slc.SlcException; import org.argeo.slc.execution.ExecutionModulesManager; import org.argeo.slc.execution.ExecutionProcess; @@ -24,7 +24,7 @@ import org.argeo.slc.execution.RealizedFlow; * sequential {@link ExecutionThread}s. */ public class ProcessThread extends Thread { - private final static CmsLog log = CmsLog.getLog(ProcessThread.class); + private final static System.Logger logger = System.getLogger(ProcessThread.class.getName()); private final ExecutionModulesManager executionModulesManager; private final ExecutionProcess process; @@ -54,7 +54,7 @@ public class ProcessThread extends Thread { // throw new SlcException("Can only execute authenticated threads"); // SecurityContextHolder.getContext().setAuthentication(authentication); - log.info("\n##\n## SLC Process #" + process.getUuid() + " STARTED\n##\n"); + logger.log(Level.INFO, "\n##\n## SLC Process #" + process.getUuid() + " STARTED\n##\n"); // Start logging new LoggingThread().start(); @@ -85,7 +85,7 @@ public class ProcessThread extends Thread { return; } catch (Exception e) { String msg = "Process " + getProcess().getUuid() + " failed unexpectedly."; - log.error(msg, e); + logger.log(Level.ERROR, msg, e); getProcessThreadGroup() .dispatchAddStep(new ExecutionStep("Process", ExecutionStep.ERROR, msg + " " + e.getMessage())); } @@ -118,7 +118,7 @@ public class ProcessThread extends Thread { process.setStatus(ExecutionProcess.COMPLETED); // executionModulesManager.dispatchUpdateStatus(process, oldStatus, // process.getStatus()); - log.info("\n## SLC Process #" + process.getUuid() + " " + process.getStatus() + "\n"); + logger.log(Level.INFO, "\n## SLC Process #" + process.getUuid() + " " + process.getStatus() + "\n"); } /** Called when being killed */ @@ -129,7 +129,7 @@ public class ProcessThread extends Thread { try { executionThread.interrupt(); } catch (Exception e) { - log.error("Cannot interrupt " + executionThread); + logger.log(Level.ERROR, "Cannot interrupt " + executionThread); } } processThreadGroup.interrupt(); @@ -148,7 +148,6 @@ public class ProcessThread extends Thread { } } - /** @return the (distinct) thread used for this execution */ protected final void execute(RealizedFlow realizedFlow, Boolean synchronous) throws InterruptedException { if (killed) return;