Skip to content
Snippets Groups Projects
Commit 7ac290da authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

Set clock stage terminationstrategy

parent d83dea0e
No related branches found
No related tags found
No related merge requests found
package teetime.framework;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import teetime.framework.pipe.PipeFactoryRegistry;
......@@ -11,19 +13,19 @@ public class AnalysisConfiguration {
private final List<Runnable> threadableStageJobs = new LinkedList<Runnable>();
private final List<Stage> consumerStages = new LinkedList<Stage>();
private final List<Stage> finiteProducerStages = new LinkedList<Stage>();
private final List<Stage> infiniteProducerStages = new LinkedList<Stage>();
private final Set<Stage> consumerStages = new HashSet<Stage>();
private final Set<Stage> finiteProducerStages = new HashSet<Stage>();
private final Set<Stage> infiniteProducerStages = new HashSet<Stage>();
public List<Stage> getConsumerStages() {
public Set<Stage> getConsumerStages() {
return this.consumerStages;
}
public List<Stage> getFiniteProducerStages() {
public Set<Stage> getFiniteProducerStages() {
return this.finiteProducerStages;
}
public List<Stage> getInfiniteProducerStages() {
public Set<Stage> getInfiniteProducerStages() {
return this.infiniteProducerStages;
}
......
package teetime.stage;
import teetime.framework.ProducerStage;
import teetime.framework.TerminationStrategy;
public class Clock extends ProducerStage<Long> {
......@@ -9,6 +10,11 @@ public class Clock extends ProducerStage<Long> {
private long initialDelayInMs;
private long intervalDelayInMs;
@Override
public TerminationStrategy getTerminationStrategy() {
return TerminationStrategy.BY_INTERRUPT;
}
@Override
protected void execute() {
if (!this.initialDelayExceeded) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment