Skip to content
Snippets Groups Projects
Commit a00cabaa authored by Christian Wulf's avatar Christian Wulf
Browse files

implemented unfinished generic signal concept;

implemented example signals for starting, validating, and terminating
parent 6bca3bd2
No related branches found
No related tags found
No related merge requests found
...@@ -86,14 +86,15 @@ public class Printer<T> extends ConsumerStage<T> { ...@@ -86,14 +86,15 @@ public class Printer<T> extends ConsumerStage<T> {
} }
@Override @Override
public void onStart() { public void onStarting() {
super.onStarting();
this.initializeStream(); this.initializeStream();
} }
@Override @Override
protected void onFinished() { public void onTerminating() {
this.closeStream(); this.closeStream();
super.onFinished(); super.onTerminating();
} }
private void initializeStream() { private void initializeStream() {
......
...@@ -76,13 +76,13 @@ public class TCPReader extends ProducerStage<IMonitoringRecord> { ...@@ -76,13 +76,13 @@ public class TCPReader extends ProducerStage<IMonitoringRecord> {
} }
@Override @Override
public void onStart() { public void onStarting() {
this.recordFactory = new RecordFactory(); this.recordFactory = new RecordFactory();
this.register(); this.register();
this.tcpStringReader = new TCPStringReader(this.port2, this.stringRegistry); this.tcpStringReader = new TCPStringReader(this.port2, this.stringRegistry);
this.tcpStringReader.start(); this.tcpStringReader.start();
super.onStart(); super.onStarting();
} }
private void register() { private void register() {
......
...@@ -78,7 +78,7 @@ public class TCPReaderSink extends ProducerStage<IMonitoringRecord> { ...@@ -78,7 +78,7 @@ public class TCPReaderSink extends ProducerStage<IMonitoringRecord> {
} }
@Override @Override
public void onStart() { public void onStarting() {
this.executorService.scheduleAtFixedRate(new Runnable() { this.executorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -88,7 +88,7 @@ public class TCPReaderSink extends ProducerStage<IMonitoringRecord> { ...@@ -88,7 +88,7 @@ public class TCPReaderSink extends ProducerStage<IMonitoringRecord> {
this.tcpStringReader = new TCPStringReader(this.port2, this.stringRegistry); this.tcpStringReader = new TCPStringReader(this.port2, this.stringRegistry);
this.tcpStringReader.start(); this.tcpStringReader.start();
super.onStart(); super.onStarting();
} }
@Override @Override
......
...@@ -58,9 +58,9 @@ public class BinaryFile2RecordFilter extends ConsumerStage<File> { ...@@ -58,9 +58,9 @@ public class BinaryFile2RecordFilter extends ConsumerStage<File> {
} }
@Override @Override
public void onStart() { public void onStarting() {
this.recordFromBinaryFileCreator = new RecordFromBinaryFileCreator(this.logger, this.classNameRegistryRepository); this.recordFromBinaryFileCreator = new RecordFromBinaryFileCreator(this.logger, this.classNameRegistryRepository);
super.onStart(); super.onStarting();
} }
public ClassNameRegistryRepository getClassNameRegistryRepository() { public ClassNameRegistryRepository getClassNameRegistryRepository() {
......
...@@ -44,12 +44,12 @@ public class StringBufferFilter<T> extends ConsumerStage<T> { ...@@ -44,12 +44,12 @@ public class StringBufferFilter<T> extends ConsumerStage<T> {
} }
@Override @Override
public void onStart() { public void onStarting() {
for (final AbstractDataTypeHandler<?> handler : this.dataTypeHandlers) { for (final AbstractDataTypeHandler<?> handler : this.dataTypeHandlers) {
handler.setLogger(this.logger); handler.setLogger(this.logger);
handler.setStringRepository(this.kiekerHashMap); handler.setStringRepository(this.kiekerHashMap);
} }
super.onStart(); super.onStarting();
} }
private T handle(final T object) { private T handle(final T object) {
......
...@@ -24,11 +24,11 @@ import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; ...@@ -24,11 +24,11 @@ import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import teetime.variant.explicitScheduling.framework.core.Analysis; import teetime.variant.explicitScheduling.framework.core.Analysis;
import teetime.variant.methodcallWithPorts.framework.core.Pipeline; import teetime.variant.methodcallWithPorts.framework.core.Pipeline;
import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; import teetime.variant.methodcallWithPorts.framework.core.RunnableStage;
import teetime.variant.methodcallWithPorts.framework.core.Signal;
import teetime.variant.methodcallWithPorts.framework.core.StageWithPort; import teetime.variant.methodcallWithPorts.framework.core.StageWithPort;
import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe;
import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe;
import teetime.variant.methodcallWithPorts.framework.core.pipe.UnorderedGrowablePipe; import teetime.variant.methodcallWithPorts.framework.core.pipe.UnorderedGrowablePipe;
import teetime.variant.methodcallWithPorts.framework.core.signal.TerminatingSignal;
import teetime.variant.methodcallWithPorts.stage.CollectorSink; import teetime.variant.methodcallWithPorts.stage.CollectorSink;
import teetime.variant.methodcallWithPorts.stage.NoopFilter; import teetime.variant.methodcallWithPorts.stage.NoopFilter;
import teetime.variant.methodcallWithPorts.stage.ObjectProducer; import teetime.variant.methodcallWithPorts.stage.ObjectProducer;
...@@ -160,7 +160,7 @@ public class MethodCallThroughputAnalysis17 extends Analysis { ...@@ -160,7 +160,7 @@ public class MethodCallThroughputAnalysis17 extends Analysis {
startPipe.add(this.inputObjectCreator.create()); startPipe.add(this.inputObjectCreator.create());
} }
// startPipe.close(); // startPipe.close();
startPipe.setSignal(Signal.FINISHED); startPipe.setSignal(new TerminatingSignal());
UnorderedGrowablePipe.connect(relay.getOutputPort(), startTimestampFilter.getInputPort()); UnorderedGrowablePipe.connect(relay.getOutputPort(), startTimestampFilter.getInputPort());
......
Subproject commit 75998aa20b7ec897ec321c1f94192de888f2dc6e Subproject commit 88e1e25f9519b250258c7e5ada30935975ab2d10
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment