X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fruntime%2FAbstractAgent.java;h=455bd9ccba5410039060fd29ed9e3d5448469cc4;hb=9daa55ce316d52ffd8f30dc0d1b516ccf78a8c73;hp=fc34d1f178b13f003cc2b74b3ba49d6c4e38173e;hpb=587e0275296f6ad1291613839aae7d4157cc84f5;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/runtime/AbstractAgent.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/runtime/AbstractAgent.java index fc34d1f17..455bd9ccb 100644 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/runtime/AbstractAgent.java +++ b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/runtime/AbstractAgent.java @@ -1,41 +1,23 @@ package org.argeo.slc.core.runtime; -import java.util.Map; -import java.util.Properties; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.argeo.slc.execution.ExecutionModulesManager; import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.runtime.SlcApplication; -import org.argeo.slc.runtime.SlcExecutionContext; public abstract class AbstractAgent { - private final static Log log = LogFactory.getLog(AbstractAgent.class); +// private final static Log log = LogFactory.getLog(AbstractAgent.class); - private SlcApplication slcApplication; + private ExecutionModulesManager modulesManager; + public void runSlcExecution(final SlcExecution slcExecution) { + modulesManager.process(slcExecution); + } - protected void runSlcExecution(final SlcExecution slcExecution) { - // TODO: in a separate process - Thread thread = new Thread("SlcExecution " + slcExecution.getUuid()) { - public void run() { - Properties props = new Properties(); - Map attributes = slcExecution.getAttributes(); - for (String key : attributes.keySet()) { - props.setProperty(key, attributes.get(key)); - if (log.isTraceEnabled()) - log.trace(key + "=" + props.getProperty(key)); - } - slcApplication.execute(slcExecution, props, null, null); - log.debug("Thread for SLC execution #" + slcExecution.getUuid() - + " finished."); - } - }; - thread.start(); + public void setModulesManager(ExecutionModulesManager modulesManager) { + this.modulesManager = modulesManager; } - public void setSlcApplication( - SlcApplication application) { - this.slcApplication = application; + public ExecutionModulesManager getModulesManager() { + return modulesManager; } + }