diff --git a/src/main/java/teetime/framework/AbstractStage.java b/src/main/java/teetime/framework/AbstractStage.java index 6f3cf0e27497ff4fb545f13784582a601c31c1d4..ab552d4d1bb97bdde94efb9deb962f84f292bd0d 100644 --- a/src/main/java/teetime/framework/AbstractStage.java +++ b/src/main/java/teetime/framework/AbstractStage.java @@ -130,6 +130,9 @@ public abstract class AbstractStage extends Stage { /** * Creates and adds an InputPort to the stage * + * @param <T> + * the type of elements to be received + * * @return Newly added InputPort * */ @@ -143,7 +146,9 @@ public abstract class AbstractStage extends Stage { /** * Creates and adds an InputPort to the stage * - * @param type + * @param <T> + * the type of elements to be received + * * @return Newly added InputPort */ protected <T> InputPort<T> createInputPort(final Class<T> type) { @@ -155,6 +160,9 @@ public abstract class AbstractStage extends Stage { /** * Creates and adds an OutputPort to the stage * + * @param <T> + * the type of elements to be sent + * * @return Newly added OutputPort * */ @@ -168,7 +176,9 @@ public abstract class AbstractStage extends Stage { /** * Creates and adds an OutputPort to the stage * - * @param type + * @param <T> + * the type of elements to be sent + * * @return Newly added OutputPort */ protected <T> OutputPort<T> createOutputPort(final Class<T> type) { diff --git a/src/main/java/teetime/framework/AnalysisConfiguration.java b/src/main/java/teetime/framework/AnalysisConfiguration.java index 26139ce63fb552b01dd65c886c314ad3a4eaedd7..f9b14001a97abb2e3c86d3a487052618461a016b 100644 --- a/src/main/java/teetime/framework/AnalysisConfiguration.java +++ b/src/main/java/teetime/framework/AnalysisConfiguration.java @@ -82,7 +82,11 @@ public abstract class AnalysisConfiguration { * Connects two stages with a pipe within the same thread. * * @param sourcePort + * {@link OutputPort} of the sending stage * @param targetPort + * {@link InputPort} of the sending stage + * @param <T> + * the type of elements to be sent * @return * the pipe instance which connects the two given stages * @@ -97,7 +101,11 @@ public abstract class AnalysisConfiguration { * Connects two stages with a bounded pipe within two separate threads. * * @param sourcePort + * {@link OutputPort} of the sending stage * @param targetPort + * {@link InputPort} of the sending stage + * @param <T> + * the type of elements to be sent * @return * the pipe instance which connects the two given stages * @@ -112,7 +120,11 @@ public abstract class AnalysisConfiguration { * Connects two stages with a unbounded pipe within two separate threads. * * @param sourcePort + * {@link OutputPort} of the sending stage * @param targetPort + * {@link InputPort} of the sending stage + * @param <T> + * the type of elements to be sent * @return * the pipe instance which connects the two given stages * @@ -127,10 +139,15 @@ public abstract class AnalysisConfiguration { * Connects two stages with a bounded pipe within two separate threads. * * @param sourcePort + * {@link OutputPort} of the sending stage * @param targetPort + * {@link InputPort} of the sending stage * @param capacity * capacity of the underlying queue + * @param <T> + * the type of elements to be sent * @return + * the pipe instance which connects the two given stages * * @deprecated since 1.2. Use {@link #connectPorts(OutputPort, InputPort)} instead. */ @@ -143,10 +160,15 @@ public abstract class AnalysisConfiguration { * Connects two stages with a unbounded pipe within two separate threads. * * @param sourcePort + * {@link OutputPort} of the sending stage * @param targetPort + * {@link InputPort} of the sending stage * @param capacity * capacity of the underlying queue + * @param <T> + * the type of elements to be sent * @return + * the pipe instance which connects the two given stages * * @deprecated since 1.2. Use {@link #connectPorts(OutputPort, InputPort)} instead. */ @@ -156,12 +178,14 @@ public abstract class AnalysisConfiguration { } /** - * Connects two ports with a pipe. + * Connects two ports with a pipe with a default capacity of currently 4 * * @param sourcePort - * port from the sending stage + * {@link OutputPort} of the sending stage * @param targetPort - * port from the receiving stage + * {@link InputPort} of the sending stage + * @param <T> + * the type of elements to be sent */ protected <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { connectPorts(sourcePort, targetPort, 4); @@ -171,11 +195,13 @@ public abstract class AnalysisConfiguration { * Connects to ports with a pipe of a certain capacity * * @param sourcePort - * port from the sending stage + * {@link OutputPort} of the sending stage * @param targetPort - * port from the receiving stage + * {@link InputPort} of the sending stage * @param capacity * the pipe is set to this capacity, if the value is greater than 0. If it is 0, than the pipe is unbounded, thus growing of the pipe is enabled. + * @param <T> + * the type of elements to be sent */ protected <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) { connections.add(new Connection<T>(sourcePort, targetPort, capacity)); diff --git a/src/main/java/teetime/framework/InputPort.java b/src/main/java/teetime/framework/InputPort.java index f6e2a30d170607b2f237ec57a4145810ce6f2024..d2ffc2590495409e7fac4371e556b088f98ba80e 100644 --- a/src/main/java/teetime/framework/InputPort.java +++ b/src/main/java/teetime/framework/InputPort.java @@ -15,6 +15,15 @@ */ package teetime.framework; +/** + * + * @author Christian Wulf + * + * @param <T> + * the type of elements to be sent + * + * @since 1.0 + */ public final class InputPort<T> extends AbstractPort<T> { InputPort(final Class<T> type, final Stage owningStage) { diff --git a/src/main/java/teetime/framework/Stage.java b/src/main/java/teetime/framework/Stage.java index aff67ce4569d48bafb9a9bc8d2a8c47e626bff49..a2c867ffff7dc14ae1df452d6ac8f291fc1210da 100644 --- a/src/main/java/teetime/framework/Stage.java +++ b/src/main/java/teetime/framework/Stage.java @@ -131,6 +131,9 @@ public abstract class Stage { /** * Event that is triggered within the initialization phase of the analysis. * It does not count to the execution time. + * + * @throws Exception + * an arbitrary exception if an error occurs during the initialization */ @SuppressWarnings("PMD.SignatureDeclareThrowsException") public abstract void onInitializing() throws Exception; diff --git a/src/main/java/teetime/framework/exceptionHandling/AbstractExceptionListener.java b/src/main/java/teetime/framework/exceptionHandling/AbstractExceptionListener.java index 8cbc63dd6a2fd7d692e3c590fff49f9bd17ed0a0..7f1c774f24791fe4843a9d174643a993e9218c54 100644 --- a/src/main/java/teetime/framework/exceptionHandling/AbstractExceptionListener.java +++ b/src/main/java/teetime/framework/exceptionHandling/AbstractExceptionListener.java @@ -21,8 +21,9 @@ import org.slf4j.LoggerFactory; import teetime.framework.Stage; /** - * Represent a minimalistic StageExceptionListener. Listener which extend from this one, must a least implement this functionality. - * This abstract class provides a Logger {@link #logger} and a method to terminate the threads execution {@link #terminateExecution()}. + * Represents a minimalistic StageExceptionListener. + * Listener which extend from this one, must a least implement this functionality. + * This abstract class provides a Logger {@link #logger} and the method {@link #onStageException(Exception, Stage)} which is called on every raised exception. */ public abstract class AbstractExceptionListener { diff --git a/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java b/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java index 2b3a024aa4da61fe523adf88687dfb6690242471..f8347ce16f51693c3179ee0bf4ea0de4817693e0 100644 --- a/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java +++ b/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java @@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory; * <p> * To get a PipeFactory instance, call {@link #getPipeFactory(ThreadCommunication, PipeOrdering, boolean)}. * - * @Deprecated since 1.2 + * @deprecated since 1.2 */ @Deprecated public final class PipeFactoryRegistry {