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

reduced visibility of executeStage;

minor refactorings and javadoc;
added an additional state for stages
parent 6dc8ee7a
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ public abstract class AbstractConsumerStage<I> extends AbstractStage {
}
@Override
public final void executeStage() {
protected final void executeStage() {
final I element = this.getInputPort().receive();
if (null == element) {
returnNoElement();
......
......@@ -36,7 +36,7 @@ public abstract class AbstractProducerStage<O> extends AbstractStage {
}
@Override
public void executeStage() {
protected void executeStage() {
try {
this.execute();
} catch (Exception e) {
......
......@@ -33,7 +33,7 @@ public abstract class AbstractStage extends Stage {
private InputPort<?>[] inputPorts = new InputPort<?>[0];
private OutputPort<?>[] outputPorts = new OutputPort<?>[0];
private StageState currentState = StageState.CREATED;
private StageState currentState = StageState.NOT_INITIALIZED;
@Override
public InputPort<?>[] getInputPorts() {
......@@ -73,18 +73,18 @@ public abstract class AbstractStage extends Stage {
* @return <code>true</code> if this stage has already received the given <code>signal</code>, <code>false</code> otherwise
*/
protected boolean signalAlreadyReceived(final ISignal signal, final InputPort<?> inputPort) {
if (this.triggeredSignals.contains(signal)) {
boolean signalAlreadyReceived = this.triggeredSignals.contains(signal);
if (signalAlreadyReceived) {
if (logger.isTraceEnabled()) {
logger.trace("Got signal: " + signal + " again from input port: " + inputPort);
}
return true;
} else {
if (logger.isTraceEnabled()) {
logger.trace("Got signal: " + signal + " from input port: " + inputPort);
}
this.triggeredSignals.add(signal);
return false;
}
return signalAlreadyReceived;
}
@Override
......
......@@ -17,6 +17,7 @@ package teetime.framework;
public enum StageState {
NOT_INITIALIZED,
INITIALIZED,
CREATED,
VALIDATING, VALIDATED,
......
......@@ -58,7 +58,7 @@ public final class InstanceOfFilter<I, O extends I> extends AbstractConsumerStag
*
* @return the output port that is used when the element is a (sub)type of the internal type attribute
*
* @deprecated 1.1. Use {@link #getMatchedOutputPort()} instead.
* @deprecated Since 1.1. Use {@link #getMatchedOutputPort()} instead.
*/
@Deprecated
public OutputPort<O> getOutputPort() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment