]> git.argeo.org Git - gpl/argeo-slc.git/blob - ProcessThreadGroup.java
7084f12c010749bb1cedab019917ca7661fcdb45
[gpl/argeo-slc.git] / ProcessThreadGroup.java
1 package org.argeo.slc.core.execution;
2
3 import java.util.ArrayList;
4 import java.util.Iterator;
5 import java.util.List;
6
7 import org.argeo.slc.process.SlcExecution;
8 import org.argeo.slc.process.SlcExecutionNotifier;
9 import org.argeo.slc.process.SlcExecutionStep;
10
11 public class ProcessThreadGroup extends ThreadGroup {
12 private final ProcessThread processThread;
13
14 public ProcessThreadGroup(ProcessThread processThread) {
15 super("SLC Process #" + processThread.getSlcProcess().getUuid()
16 + " thread group");
17 this.processThread = processThread;
18 }
19
20 public SlcExecution getSlcProcess() {
21 return processThread.getSlcProcess();
22 }
23
24 public void dispatchAddStep(SlcExecutionStep step) {
25 processThread.getSlcProcess().getSteps().add(step);
26 List<SlcExecutionStep> steps = new ArrayList<SlcExecutionStep>();
27 steps.add(step);
28 for (Iterator<SlcExecutionNotifier> it = processThread
29 .getExecutionModulesManager().getSlcExecutionNotifiers()
30 .iterator(); it.hasNext();) {
31 it.next().addSteps(processThread.getSlcProcess(), steps);
32 }
33 }
34
35 }