Skip to content
Snippets Groups Projects
Commit 9062a4b6 authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

added active flag

typo
parent 3e74fe4a
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,7 @@ public abstract class AbstractCompositeStage { ...@@ -54,6 +54,7 @@ public abstract class AbstractCompositeStage {
AbstractRunnableStage runnable = AbstractRunnableStage.create(stage); AbstractRunnableStage runnable = AbstractRunnableStage.create(stage);
Thread newThread = new TeeTimeThread(runnable, threadName); Thread newThread = new TeeTimeThread(runnable, threadName);
stage.setOwningThread(newThread); stage.setOwningThread(newThread);
stage.setActive(true);
} }
/** /**
......
...@@ -50,6 +50,8 @@ public abstract class Stage { ...@@ -50,6 +50,8 @@ public abstract class Stage {
/** The owning thread of this stage if this stage is directly executed by a {@link AbstractRunnableStage}, <code>null</code> otherwise. */ /** The owning thread of this stage if this stage is directly executed by a {@link AbstractRunnableStage}, <code>null</code> otherwise. */
private Thread owningThread; private Thread owningThread;
private boolean isActive;
private ConfigurationContext owningContext; private ConfigurationContext owningContext;
ConfigurationContext getOwningContext() { ConfigurationContext getOwningContext() {
...@@ -181,4 +183,12 @@ public abstract class Stage { ...@@ -181,4 +183,12 @@ public abstract class Stage {
protected abstract void removeDynamicPort(InputPort<?> inputPort); protected abstract void removeDynamicPort(InputPort<?> inputPort);
public boolean isActive() {
return isActive;
}
void setActive(final boolean isActive) {
this.isActive = isActive;
}
} }
...@@ -27,17 +27,17 @@ public class AbstractCompositeStageTest { ...@@ -27,17 +27,17 @@ public class AbstractCompositeStageTest {
@Ignore @Ignore
@Test @Test
public void testNestedStages() { public void testNestedStages() {
Execution<NestesConfig> exec = new Execution<NestesConfig>(new NestesConfig()); Execution<NestedConf> exec = new Execution<NestedConf>(new NestedConf());
// assertThat(exec.getConfiguration().getContext().getThreadableStages().size(), is(3)); // assertThat(exec.getConfiguration().getContext().getThreadableStages().size(), is(3));
} }
private class NestesConfig extends Configuration { private class NestedConf extends Configuration {
private final InitialElementProducer<Object> init; private final InitialElementProducer<Object> init;
private final Sink sink; private final Sink sink;
private final TestNestingCompositeStage compositeStage; private final TestNestingCompositeStage compositeStage;
public NestesConfig() { public NestedConf() {
init = new InitialElementProducer<Object>(new Object()); init = new InitialElementProducer<Object>(new Object());
sink = new Sink(); sink = new Sink();
compositeStage = new TestNestingCompositeStage(); compositeStage = new TestNestingCompositeStage();
......
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