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 { ...@@ -27,7 +27,7 @@ public abstract class AbstractConsumerStage<I> extends AbstractStage {
} }
@Override @Override
public final void executeStage() { protected final void executeStage() {
final I element = this.getInputPort().receive(); final I element = this.getInputPort().receive();
if (null == element) { if (null == element) {
returnNoElement(); returnNoElement();
......
...@@ -36,7 +36,7 @@ public abstract class AbstractProducerStage<O> extends AbstractStage { ...@@ -36,7 +36,7 @@ public abstract class AbstractProducerStage<O> extends AbstractStage {
} }
@Override @Override
public void executeStage() { protected void executeStage() {
try { try {
this.execute(); this.execute();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -33,7 +33,7 @@ public abstract class AbstractStage extends Stage { ...@@ -33,7 +33,7 @@ public abstract class AbstractStage extends Stage {
private InputPort<?>[] inputPorts = new InputPort<?>[0]; private InputPort<?>[] inputPorts = new InputPort<?>[0];
private OutputPort<?>[] outputPorts = new OutputPort<?>[0]; private OutputPort<?>[] outputPorts = new OutputPort<?>[0];
private StageState currentState = StageState.CREATED; private StageState currentState = StageState.NOT_INITIALIZED;
@Override @Override
public InputPort<?>[] getInputPorts() { public InputPort<?>[] getInputPorts() {
...@@ -73,18 +73,18 @@ public abstract class AbstractStage extends Stage { ...@@ -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 * @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) { 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()) { if (logger.isTraceEnabled()) {
logger.trace("Got signal: " + signal + " again from input port: " + inputPort); logger.trace("Got signal: " + signal + " again from input port: " + inputPort);
} }
return true;
} else { } else {
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
logger.trace("Got signal: " + signal + " from input port: " + inputPort); logger.trace("Got signal: " + signal + " from input port: " + inputPort);
} }
this.triggeredSignals.add(signal); this.triggeredSignals.add(signal);
return false;
} }
return signalAlreadyReceived;
} }
@Override @Override
......
...@@ -17,6 +17,7 @@ package teetime.framework; ...@@ -17,6 +17,7 @@ package teetime.framework;
public enum StageState { public enum StageState {
NOT_INITIALIZED,
INITIALIZED, INITIALIZED,
CREATED, CREATED,
VALIDATING, VALIDATED, VALIDATING, VALIDATED,
......
...@@ -58,7 +58,7 @@ public final class InstanceOfFilter<I, O extends I> extends AbstractConsumerStag ...@@ -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 * @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 @Deprecated
public OutputPort<O> getOutputPort() { public OutputPort<O> getOutputPort() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment