diff --git a/src/main/java/teetime/framework/AnalysisConfiguration.java b/src/main/java/teetime/framework/AnalysisConfiguration.java index 1a291c2e54dacc5b376b0a2420f064c9e741acd3..c051594442e7982ccad776bf71597a6aaeb95547 100644 --- a/src/main/java/teetime/framework/AnalysisConfiguration.java +++ b/src/main/java/teetime/framework/AnalysisConfiguration.java @@ -3,8 +3,12 @@ package teetime.framework; import java.util.LinkedList; import java.util.List; +import teetime.framework.pipe.PipeFactoryRegistry; + public class AnalysisConfiguration { + protected static final PipeFactoryRegistry PIPE_FACTORY_REGISTRY = PipeFactoryRegistry.INSTANCE; + private final List<HeadStage> consumerStages = new LinkedList<HeadStage>(); private final List<HeadStage> finiteProducerStages = new LinkedList<HeadStage>(); private final List<HeadStage> infiniteProducerStages = new LinkedList<HeadStage>(); diff --git a/src/performancetest/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java b/src/performancetest/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java index 33e262c8eb21c5d879ffddbba8d6e0b4e56e11a7..400c4cd406fafb5b6dbd2f1f0095b08d1a2d02cf 100644 --- a/src/performancetest/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java +++ b/src/performancetest/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java @@ -2,20 +2,15 @@ package teetime.examples.loopStage; import teetime.framework.AnalysisConfiguration; import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; -import teetime.examples.loopStage.Countdown; - public class LoopStageAnalysisConfiguration extends AnalysisConfiguration { - private final PipeFactoryRegistry pipeFactory = PipeFactoryRegistry.INSTANCE; - public LoopStageAnalysisConfiguration() { Countdown countdown = new Countdown(10); - IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true); + IPipeFactory factory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true); factory.create(countdown.getNewCountdownOutputPort(), countdown.getCountdownInputPort()); this.getFiniteProducerStages().add(countdown); diff --git a/src/performancetest/java/teetime/examples/recordReader/RecordReaderConfiguration.java b/src/performancetest/java/teetime/examples/recordReader/RecordReaderConfiguration.java index e84ce2a1382202b1eb96cf41fdac2c1fa58201a6..fa289c0af832521ab19df88024c0b7853ef91b09 100644 --- a/src/performancetest/java/teetime/examples/recordReader/RecordReaderConfiguration.java +++ b/src/performancetest/java/teetime/examples/recordReader/RecordReaderConfiguration.java @@ -21,7 +21,6 @@ import java.util.List; import teetime.framework.AnalysisConfiguration; import teetime.framework.HeadStage; -import teetime.framework.pipe.PipeFactoryRegistry; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.CollectorSink; @@ -39,7 +38,6 @@ import kieker.common.record.IMonitoringRecord; public class RecordReaderConfiguration extends AnalysisConfiguration { private final List<IMonitoringRecord> elementCollection = new LinkedList<IMonitoringRecord>(); - private final PipeFactoryRegistry pipeFactory = PipeFactoryRegistry.INSTANCE; public RecordReaderConfiguration() { this.buildConfiguration(); @@ -59,10 +57,10 @@ public class RecordReaderConfiguration extends AnalysisConfiguration { CollectorSink<IMonitoringRecord> collector = new CollectorSink<IMonitoringRecord>(this.elementCollection); // connect stages - this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(initialElementProducer.getOutputPort(), dir2RecordsFilter.getInputPort()); - this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(dir2RecordsFilter.getOutputPort(), collector.getInputPort()); return initialElementProducer; diff --git a/src/test/java/teetime/examples/cipher/CipherConfiguration.java b/src/test/java/teetime/examples/cipher/CipherConfiguration.java index c34d4aac600e1719003732245a22b9ebcffc0057..42657bafe7e84b04f364d594d2dd42724b052a9f 100644 --- a/src/test/java/teetime/examples/cipher/CipherConfiguration.java +++ b/src/test/java/teetime/examples/cipher/CipherConfiguration.java @@ -3,7 +3,6 @@ package teetime.examples.cipher; import java.io.File; import teetime.framework.AnalysisConfiguration; -import teetime.framework.pipe.PipeFactoryRegistry; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.CipherByteArray; @@ -16,8 +15,6 @@ import teetime.stage.io.File2ByteArray; public class CipherConfiguration extends AnalysisConfiguration { - private static final PipeFactoryRegistry pipeFactoryRegistry = PipeFactoryRegistry.INSTANCE; - private final File input, output; private final String password; @@ -34,17 +31,17 @@ public class CipherConfiguration extends AnalysisConfiguration { CipherByteArray decrypt = new CipherByteArray(this.password, CipherMode.DECRYPT); ByteArrayFileWriter writer = new ByteArrayFileWriter(output); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(init.getOutputPort(), f2b.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(f2b.getOutputPort(), enc.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(enc.getOutputPort(), comp.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(comp.getOutputPort(), decomp.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(decomp.getOutputPort(), decrypt.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) .create(decrypt.getOutputPort(), writer.getInputPort()); this.getFiniteProducerStages().add(init); diff --git a/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java b/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java index ee9f67c43123198f4d91abdb068ca7f164084c17..3fe17db150f7519c505f0cfa70aee6694e5f2847 100644 --- a/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java +++ b/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java @@ -3,7 +3,6 @@ package teetime.examples.tokenizer; import java.io.File; import teetime.framework.AnalysisConfiguration; -import teetime.framework.pipe.PipeFactoryRegistry; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.ByteArray2String; @@ -18,7 +17,6 @@ import teetime.stage.io.File2ByteArray; public class TokenizerConfiguration extends AnalysisConfiguration { - private static final PipeFactoryRegistry pipeFactoryRegistry = PipeFactoryRegistry.INSTANCE; private final File input; private final String password; private final Counter<String> counter; @@ -35,17 +33,17 @@ public class TokenizerConfiguration extends AnalysisConfiguration { Tokenizer tokenizer = new Tokenizer(" "); counter = new Counter<String>(); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( init.getOutputPort(), f2b.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( f2b.getOutputPort(), decomp.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( decomp.getOutputPort(), decrypt.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( decrypt.getOutputPort(), b2s.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( b2s.getOutputPort(), tokenizer.getInputPort()); - pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( + PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false).create( tokenizer.getOutputPort(), counter.getInputPort()); this.getFiniteProducerStages().add(init);