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=d3647b7187b44343f20c0570fb3896a351bd0378;hb=043edae6e81b1ef82dbc7c0990610e8658186ac3;hp=e6b8a38451979247a9d7fc20026a145b0e992e75;hpb=61dd39a53c7635693b520e7e26583a5bde50430e;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 e6b8a3845..d3647b718 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,9 +1,11 @@ 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; @@ -11,24 +13,37 @@ import org.argeo.slc.runtime.SlcExecutionContext; public abstract class AbstractAgent { private final static Log log = LogFactory.getLog(AbstractAgent.class); - private SlcApplication slcApplication; +// private SlcApplication slcApplication; + + private ExecutionModulesManager modulesManager; protected void runSlcExecution(final SlcExecution slcExecution) { - // TODO: in a separate process - Thread thread = new Thread("SlcExecution " + slcExecution.getUuid()) { - public void run() { - slcApplication.execute(slcExecution, new Properties(), null, - null); - log.debug("Thread for SLC execution #" + slcExecution.getUuid() - + " finished."); - } - }; - thread.start(); + modulesManager.process(slcExecution); +// 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 setSlcApplication( - SlcApplication application) { - this.slcApplication = application; + public void setModulesManager(ExecutionModulesManager modulesManager) { + this.modulesManager = modulesManager; } + +// public void setSlcApplication( +// SlcApplication application) { +// this.slcApplication = application; +// } + }