]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/controllers/ProcessController.java
Execution modules view now refreshes properly
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.ui / src / main / java / org / argeo / slc / client / ui / controllers / ProcessController.java
index 595170389b04ab7f686722caef33be979bda1570..7d0a76ad552d40c05ac539935481e0a1961d2ce3 100644 (file)
@@ -6,7 +6,6 @@ import java.util.Map;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.Property;
-import javax.jcr.RepositoryException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -16,24 +15,17 @@ import org.argeo.slc.jcr.SlcJcrConstants;
 import org.argeo.slc.jcr.SlcJcrUtils;
 import org.argeo.slc.jcr.SlcNames;
 import org.argeo.slc.jcr.execution.JcrExecutionProcess;
-import org.argeo.slc.process.SlcExecution;
 import org.argeo.slc.runtime.SlcAgent;
 import org.argeo.slc.runtime.SlcAgentFactory;
-import org.argeo.slc.services.SlcExecutionService;
 
+/**
+ * We use a separate class (not in UI components) so that it can be a singleton
+ * in an application context.
+ */
 public class ProcessController {
        private final static Log log = LogFactory.getLog(ProcessController.class);
-       private SlcExecutionService slcExecutionService;
        private Map<String, SlcAgentFactory> agentFactories = new HashMap<String, SlcAgentFactory>();
 
-       public void execute(SlcAgent agent, SlcExecution slcExecution) {
-               slcExecutionService.newExecution(slcExecution);
-               agent.process(slcExecution);
-               if (log.isDebugEnabled())
-                       log.debug("SlcExcution " + slcExecution.getUuid()
-                                       + " launched on Agent " + agent.toString());
-       }
-
        public void process(Node processNode) {
                JcrExecutionProcess process = new JcrExecutionProcess(processNode);
                try {
@@ -41,7 +33,7 @@ public class ProcessController {
                        Node realizedFlowNode = processNode.getNode(SlcNames.SLC_FLOW);
                        NodeIterator nit = realizedFlowNode.getNodes();
                        if (nit.hasNext()) {
-                               // FIXME find a better way to determine which agent to use
+                               // TODO find a better way to determine which agent to use
                                // currently we check the agent of the first registered flow
                                Node firstRealizedFlow = nit.nextNode();
                                // we assume there is an nt:address
@@ -72,10 +64,6 @@ public class ProcessController {
                }
        }
 
-       public void setSlcExecutionService(SlcExecutionService slcExecutionService) {
-               this.slcExecutionService = slcExecutionService;
-       }
-
        public synchronized void register(SlcAgentFactory agentFactory,
                        Map<String, String> properties) {
                String path = properties.get(SlcJcrConstants.PROPERTY_PATH);