Revision 40096
Added by Michele Artini over 8 years ago
ProcessCountingResultSetListener.java | ||
---|---|---|
7 | 7 |
import eu.dnetlib.enabling.resultset.ResultSetListener; |
8 | 8 |
import eu.dnetlib.enabling.resultset.rmi.ResultSetException; |
9 | 9 |
import eu.dnetlib.enabling.resultset.rmi.ResultSetService; |
10 |
import eu.dnetlib.msro.workflows.graph.Process;
|
|
10 |
import eu.dnetlib.msro.workflows.procs.WorkflowProcess;
|
|
11 | 11 |
import org.apache.commons.lang.StringUtils; |
12 | 12 |
import org.apache.commons.logging.Log; |
13 | 13 |
import org.apache.commons.logging.LogFactory; |
... | ... | |
20 | 20 |
*/ |
21 | 21 |
private static final Log log = LogFactory.getLog(ProcessCountingResultSetListener.class); |
22 | 22 |
private int count; |
23 |
private Process process; |
|
23 |
private WorkflowProcess process;
|
|
24 | 24 |
private ResultSetService inputService; |
25 | 25 |
private String inputRsId; |
26 | 26 |
private ResultSet outputResulset; |
27 | 27 |
private int inputSize; |
28 | 28 |
private boolean inaccurate = false; |
29 | 29 |
|
30 |
public ProcessCountingResultSetListener(final Process process, final ResultSetService inputService, final String inputRsId) |
|
30 |
public ProcessCountingResultSetListener(final WorkflowProcess process, final ResultSetService inputService, final String inputRsId)
|
|
31 | 31 |
throws ResultSetException { |
32 | 32 |
super(); |
33 | 33 |
this.process = process; |
... | ... | |
39 | 39 |
|
40 | 40 |
@Override |
41 | 41 |
public List<String> getResult(final int from, final int to) { |
42 |
if (process.getStatus() == Process.Status.KILLED) { |
|
42 |
if (process.getStatus() == WorkflowProcess.Status.KILLED) {
|
|
43 | 43 |
this.outputResulset.close(); |
44 | 44 |
throw new RuntimeException("The workflow has been killed"); |
45 | 45 |
} |
... | ... | |
57 | 57 |
|
58 | 58 |
@Override |
59 | 59 |
public int getSize() { |
60 |
if (process.getStatus() == Process.Status.KILLED) { |
|
60 |
if (process.getStatus() == WorkflowProcess.Status.KILLED) {
|
|
61 | 61 |
this.outputResulset.close(); |
62 | 62 |
return count; |
63 | 63 |
} |
Also available in: Unified diff
partial reimplementation of the wf engine