From 51c3b1df8c6b4c22bca4fd06b460ca36f41d5e53 Mon Sep 17 00:00:00 2001 From: Nelson Tavares de Sousa <stu103017@mail.uni-kiel.de> Date: Thu, 16 Oct 2014 14:27:10 +0200 Subject: [PATCH] modified javadoc removed deprecated method --- .../teetime/framework/pipe/IPipeFactory.java | 3 +++ .../framework/pipe/PipeFactoryRegistry.java | 20 ++---------------- .../examples/cipher/CipherConfiguration.java | 21 ++++++++----------- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/main/java/teetime/framework/pipe/IPipeFactory.java b/src/main/java/teetime/framework/pipe/IPipeFactory.java index 8ed2378b..32ad20cc 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 0ade0035..47821865 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 a945e25f..5b036d17 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); -- GitLab