diff --git a/src/main/java/teetime/framework/pipe/IPipeFactory.java b/src/main/java/teetime/framework/pipe/IPipeFactory.java index 8ed2378b484e3e6edf46d44e0a268acadc8668a1..32ad20cc6330d1b0ef841e9862dc32a8f3723f8d 100644 --- a/src/main/java/teetime/framework/pipe/IPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/IPipeFactory.java @@ -5,6 +5,9 @@ import teetime.framework.OutputPort; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; +/** + * Represents the interface, which is must be defined in every PipeFactory + */ public interface IPipeFactory { /** diff --git a/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java b/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java index 0ade003548997b46fd7028c799dcd2121c42eb28..47821865af26ebaab9735c5ce9790325b8d11e3e 100644 --- a/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java +++ b/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java @@ -20,14 +20,14 @@ public class PipeFactoryRegistry { private static final Logger LOGGER = LoggerFactory.getLogger(PipeFactoryRegistry.class); /** - * Communication type between two connected stages + * Represent a communication type between two connected stages */ public enum ThreadCommunication { INTER, INTRA } /** - * Specifies the ordering behavior of the pipe + * Represents the ordering behavior of a pipe */ public enum PipeOrdering { /** @@ -56,22 +56,6 @@ public class PipeFactoryRegistry { } } - /** - * @deprecated Use {@link IPipeFactory#create(OutputPort, InputPort, int)} instead, - * after obtaining a PipeFactory with {@link #getPipeFactory(ThreadCommunication, PipeOrdering, boolean)}. - * - * @param tc - * @param ordering - * @param growable - * @param capacity - * @return - */ - @Deprecated - public IPipe create(final ThreadCommunication tc, final PipeOrdering ordering, final boolean growable, final int capacity) { - IPipeFactory pipeFactory = getPipeFactory(tc, ordering, growable); - return pipeFactory.create(capacity); - } - /** * Returns a PipeFactory Instance. * diff --git a/src/test/java/teetime/examples/cipher/CipherConfiguration.java b/src/test/java/teetime/examples/cipher/CipherConfiguration.java index a945e25f6e260cbea71c54795b49c503a029d70c..5b036d173a0cf6ae0f0a14e3a5d283ebfdc2b8bc 100644 --- a/src/test/java/teetime/examples/cipher/CipherConfiguration.java +++ b/src/test/java/teetime/examples/cipher/CipherConfiguration.java @@ -3,6 +3,7 @@ package teetime.examples.cipher; import java.io.File; import teetime.framework.AnalysisConfiguration; +import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.CipherByteArray; @@ -27,18 +28,14 @@ public class CipherConfiguration extends AnalysisConfiguration { CipherByteArray decrypt = new CipherByteArray(password, CipherMode.DECRYPT); ByteArrayFileWriter writer = new ByteArrayFileWriter(output); - PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) - .create(init.getOutputPort(), f2b.getInputPort()); - PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) - .create(f2b.getOutputPort(), enc.getInputPort()); - PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) - .create(enc.getOutputPort(), comp.getInputPort()); - PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) - .create(comp.getOutputPort(), decomp.getInputPort()); - PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) - .create(decomp.getOutputPort(), decrypt.getInputPort()); - PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false) - .create(decrypt.getOutputPort(), writer.getInputPort()); + IPipeFactory factory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); + + factory.create(init.getOutputPort(), f2b.getInputPort()); + factory.create(f2b.getOutputPort(), enc.getInputPort()); + factory.create(enc.getOutputPort(), comp.getInputPort()); + factory.create(comp.getOutputPort(), decomp.getInputPort()); + factory.create(decomp.getOutputPort(), decrypt.getInputPort()); + factory.create(decrypt.getOutputPort(), writer.getInputPort()); this.getFiniteProducerStages().add(init);