diff --git a/src/main/java/teetime/framework/AbstractService.java b/src/main/java/teetime/framework/AbstractService.java index fe716ca116f4b3dbb2e444b8259616b494c5ee9e..029a6ef6d37792c0da3747e388ec87efa2b2a4a6 100644 --- a/src/main/java/teetime/framework/AbstractService.java +++ b/src/main/java/teetime/framework/AbstractService.java @@ -10,7 +10,7 @@ package teetime.framework; * * @since 2.0 */ -public abstract class AbstractService<T> { +abstract class AbstractService<T> { abstract void onInitialize(); diff --git a/src/main/java/teetime/framework/ConfigurationContext.java b/src/main/java/teetime/framework/ConfigurationContext.java index c55e3b2207ccf3ae96d3e5126a3173e87e9bb392..20b42785763e74cf9156838112f73ee96075ba2a 100644 --- a/src/main/java/teetime/framework/ConfigurationContext.java +++ b/src/main/java/teetime/framework/ConfigurationContext.java @@ -74,7 +74,6 @@ final class ConfigurationContext { new InstantiationPipe(sourcePort, targetPort, capacity); } - // FIXME: Rename method final void addChildContext(final Stage stage) { if (!stage.owningContext.equals(EMPTY_CONTEXT)) { if (stage.owningContext != this) { // Performance diff --git a/src/main/java/teetime/framework/Execution.java b/src/main/java/teetime/framework/Execution.java index 007ec6facfaab8e377598e28cf01628d399160cc..aab805374f04fd322167efb6710ea122d032f2cb 100644 --- a/src/main/java/teetime/framework/Execution.java +++ b/src/main/java/teetime/framework/Execution.java @@ -43,7 +43,7 @@ public final class Execution<T extends Configuration> { private final T configuration; - private final boolean executionInterrupted = false; + private final ConfigurationContext configurationContext; /** * Creates a new {@link Execution} that skips validating the port connections and uses the default listener. @@ -67,6 +67,7 @@ public final class Execution<T extends Configuration> { */ public Execution(final T configuration, final boolean validationEnabled) { this.configuration = configuration; + this.configurationContext = configuration.getContext(); if (configuration.isExecuted()) { throw new IllegalStateException("Configuration was already executed"); } @@ -79,7 +80,7 @@ public final class Execution<T extends Configuration> { // BETTER validate concurrently private void validateStages() { - final Map<Stage, String> threadableStageJobs = this.configuration.getContext().getThreadableStages(); + final Map<Stage, String> threadableStageJobs = configurationContext.getThreadableStages(); for (Stage stage : threadableStageJobs.keySet()) { // // portConnectionValidator.validate(stage); // } @@ -97,11 +98,11 @@ public final class Execution<T extends Configuration> { * */ private final void init() { - ExecutionInstantiation executionInstantiation = new ExecutionInstantiation(configuration.getContext()); + ExecutionInstantiation executionInstantiation = new ExecutionInstantiation(configurationContext); executionInstantiation.instantiatePipes(); - getConfiguration().getContext().finalizeContext(); - getConfiguration().getContext().initializeServices(); + configurationContext.finalizeContext(); + configurationContext.initializeServices(); } /** @@ -113,13 +114,12 @@ public final class Execution<T extends Configuration> { * @since 2.0 */ public void waitForTermination() { - getConfiguration().getContext().waitForConfigurationToTerminate(); - ; + configurationContext.waitForConfigurationToTerminate(); } // TODO: implement private void abortEventually() { - getConfiguration().getContext().abortConfigurationRun(); + configurationContext.abortConfigurationRun(); waitForTermination(); } @@ -143,7 +143,7 @@ public final class Execution<T extends Configuration> { * @since 2.0 */ public void executeNonBlocking() { - configuration.getContext().executeConfiguration(); + configurationContext.executeConfiguration(); } /**