From 0cccdfa601fe42dd0d8a9743a4a5de632ab298b6 Mon Sep 17 00:00:00 2001 From: Nelson Tavares de Sousa <stu103017@mail.uni-kiel.de> Date: Mon, 27 Jul 2015 12:25:05 +0200 Subject: [PATCH] refactoring --- .../java/teetime/framework/ConfigurationContext.java | 12 ++++++++++++ src/main/java/teetime/framework/Execution.java | 7 ++++--- src/main/java/teetime/framework/ThreadService.java | 6 +++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/teetime/framework/ConfigurationContext.java b/src/main/java/teetime/framework/ConfigurationContext.java index a0b66853..2e4e3ece 100644 --- a/src/main/java/teetime/framework/ConfigurationContext.java +++ b/src/main/java/teetime/framework/ConfigurationContext.java @@ -104,6 +104,18 @@ final class ConfigurationContext { child.threadService = this.threadService; } + void executeConfiguration() { + this.threadService.onExecute(); + } + + void abortConfigurationRun() { + this.threadService.onTerminate(); + } + + void waitForConfigurationToTerminate() { + this.threadService.onFinish(); + } + public ThreadService getRuntimeService() { return threadService; } diff --git a/src/main/java/teetime/framework/Execution.java b/src/main/java/teetime/framework/Execution.java index f309d496..007ec6fa 100644 --- a/src/main/java/teetime/framework/Execution.java +++ b/src/main/java/teetime/framework/Execution.java @@ -113,12 +113,13 @@ public final class Execution<T extends Configuration> { * @since 2.0 */ public void waitForTermination() { - getConfiguration().getContext().getRuntimeService().onFinish(); + getConfiguration().getContext().waitForConfigurationToTerminate(); + ; } // TODO: implement private void abortEventually() { - getConfiguration().getContext().getRuntimeService().onTerminate(); + getConfiguration().getContext().abortConfigurationRun(); waitForTermination(); } @@ -142,7 +143,7 @@ public final class Execution<T extends Configuration> { * @since 2.0 */ public void executeNonBlocking() { - configuration.getContext().getRuntimeService().onExecute(); + configuration.getContext().executeConfiguration(); } /** diff --git a/src/main/java/teetime/framework/ThreadService.java b/src/main/java/teetime/framework/ThreadService.java index ab879294..985cdf0a 100644 --- a/src/main/java/teetime/framework/ThreadService.java +++ b/src/main/java/teetime/framework/ThreadService.java @@ -122,9 +122,9 @@ class ThreadService extends AbstractService<ThreadService> { thread.interrupt(); } - if (!exceptions.isEmpty()) { - throw new ExecutionException(exceptions); - } + // if (!exceptions.isEmpty()) { + // throw new ExecutionException(exceptions); + // } } private void initializeIntraStages(final Set<Stage> intraStages, final Thread thread, final AbstractExceptionListener newListener) { -- GitLab