Skip to content
Snippets Groups Projects

Merged prod cons

Merged Nelson Tavares de Sousa requested to merge merged-prod-cons into master
+ 149
41
Compare changes
  • Side-by-side
  • Inline
Files
@@ -33,6 +33,7 @@ public abstract class AbstractStage implements Stage {
protected OutputPort<?>[] cachedOutputPorts;
private final Map<ISignal, Void> visited = new HashMap<ISignal, Void>();
private boolean shouldTerminate;
public AbstractStage() {
this.id = UUID.randomUUID().toString(); // the id should only be represented by a UUID, not additionally by the class name
@@ -125,7 +126,7 @@ public abstract class AbstractStage implements Stage {
}
public void onTerminating() throws Exception {
// empty default implementation
terminate();
}
protected <T> InputPort<T> createInputPort() {
@@ -162,4 +163,19 @@ public abstract class AbstractStage implements Stage {
return this.getClass().getName() + ": " + this.id;
}
@Override
public void terminate() {
this.shouldTerminate = true;
}
@Override
public boolean shouldBeTerminated() {
return this.shouldTerminate;
}
@Override
public TerminationStrategy getTerminationStrategy() {
return TerminationStrategy.BY_SIGNAL;
}
}
Loading