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

minor refactoring

parent 8386b66b
No related branches found
No related tags found
No related merge requests found
......@@ -90,22 +90,7 @@ public abstract class AbstractStage extends Stage {
@Override
public void onInitializing() throws Exception {
this.connectUnconnectedOutputPorts();
currentState = StageState.INITIALIZED;
logger.trace("Initialized.");
}
@Override
public void onValidating(final List<InvalidPortConnection> invalidPortConnections) {
this.validateOutputPorts(invalidPortConnections);
currentState = StageState.VALIDATED;
logger.trace("Validated.");
}
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Override
public void onStarting() throws Exception {
currentState = StageState.STARTED;
logger.trace("Started.");
changeState(StageState.INITIALIZED);
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
......@@ -120,11 +105,27 @@ public abstract class AbstractStage extends Stage {
}
}
private void changeState(final StageState newState) {
currentState = newState;
logger.trace(newState.toString());
}
@Override
public void onValidating(final List<InvalidPortConnection> invalidPortConnections) {
this.validateOutputPorts(invalidPortConnections);
changeState(StageState.VALIDATED);
}
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Override
public void onStarting() throws Exception {
changeState(StageState.STARTED);
}
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Override
public void onTerminating() throws Exception {
currentState = StageState.TERMINATED;
logger.trace("Terminated.");
changeState(StageState.TERMINATED);
}
/**
......
......@@ -131,7 +131,7 @@ public class DistributorTest {
}
@Test
public void cloneForSimpleBeanShoulWork() throws Exception {
public void cloneForSimpleBeanShouldWork() throws Exception {
final Distributor<SimpleBean> distributor = new Distributor<SimpleBean>(new CloneStrategy());
final List<SimpleBean> results = new ArrayList<SimpleBean>();
final SimpleBean originalBean = new SimpleBean(42);
......
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