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

visibility changes and renameing

parent 0cccdfa6
Branches
Tags
No related merge requests found
...@@ -33,7 +33,7 @@ abstract class AbstractRunnableStage implements Runnable { ...@@ -33,7 +33,7 @@ abstract class AbstractRunnableStage implements Runnable {
this.logger = LoggerFactory.getLogger(stage.getClass()); this.logger = LoggerFactory.getLogger(stage.getClass());
if (stage.getTerminationStrategy() != TerminationStrategy.BY_INTERRUPT) { if (stage.getTerminationStrategy() != TerminationStrategy.BY_INTERRUPT) {
stage.owningContext.getRuntimeService().getRunnableCounter().inc(); stage.owningContext.getThreadService().getRunnableCounter().inc();
} }
} }
...@@ -50,7 +50,7 @@ abstract class AbstractRunnableStage implements Runnable { ...@@ -50,7 +50,7 @@ abstract class AbstractRunnableStage implements Runnable {
} while (!stage.shouldBeTerminated()); } while (!stage.shouldBeTerminated());
} catch (TerminateException e) { } catch (TerminateException e) {
this.stage.terminate(); this.stage.terminate();
stage.owningContext.getRuntimeService().onTerminate(); stage.owningContext.getThreadService().onTerminate();
throw e; // FIXME: Still needed? throw e; // FIXME: Still needed?
} finally { } finally {
afterStageExecution(); afterStageExecution();
...@@ -64,7 +64,7 @@ abstract class AbstractRunnableStage implements Runnable { ...@@ -64,7 +64,7 @@ abstract class AbstractRunnableStage implements Runnable {
} }
} finally { } finally {
if (stage.getTerminationStrategy() != TerminationStrategy.BY_INTERRUPT) { if (stage.getTerminationStrategy() != TerminationStrategy.BY_INTERRUPT) {
stage.owningContext.getRuntimeService().getRunnableCounter().dec(); stage.owningContext.getThreadService().getRunnableCounter().dec();
} }
} }
......
...@@ -32,7 +32,7 @@ import teetime.framework.pipe.InstantiationPipe; ...@@ -32,7 +32,7 @@ import teetime.framework.pipe.InstantiationPipe;
*/ */
final class ConfigurationContext { final class ConfigurationContext {
public static final ConfigurationContext EMPTY_CONTEXT = new ConfigurationContext(null); static final ConfigurationContext EMPTY_CONTEXT = new ConfigurationContext(null);
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationContext.class); private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationContext.class);
...@@ -52,7 +52,7 @@ final class ConfigurationContext { ...@@ -52,7 +52,7 @@ final class ConfigurationContext {
* @see AbstractCompositeStage#addThreadableStage(Stage) * @see AbstractCompositeStage#addThreadableStage(Stage)
*/ */
final void addThreadableStage(final Stage stage, final String threadName) { final void addThreadableStage(final Stage stage, final String threadName) {
childFunction(stage); addChildContext(stage);
threadService.addThreadableStage(stage, threadName); threadService.addThreadableStage(stage, threadName);
} }
...@@ -69,13 +69,13 @@ final class ConfigurationContext { ...@@ -69,13 +69,13 @@ final class ConfigurationContext {
LOGGER.warn("Overwriting existing pipe while connecting stages " + LOGGER.warn("Overwriting existing pipe while connecting stages " +
sourcePort.getOwningStage().getId() + " and " + targetPort.getOwningStage().getId() + "."); sourcePort.getOwningStage().getId() + " and " + targetPort.getOwningStage().getId() + ".");
} }
childFunction(sourcePort.getOwningStage()); addChildContext(sourcePort.getOwningStage());
childFunction(targetPort.getOwningStage()); addChildContext(targetPort.getOwningStage());
new InstantiationPipe(sourcePort, targetPort, capacity); new InstantiationPipe(sourcePort, targetPort, capacity);
} }
// FIXME: Rename method // FIXME: Rename method
final void childFunction(final Stage stage) { final void addChildContext(final Stage stage) {
if (!stage.owningContext.equals(EMPTY_CONTEXT)) { if (!stage.owningContext.equals(EMPTY_CONTEXT)) {
if (stage.owningContext != this) { // Performance if (stage.owningContext != this) { // Performance
childs.add(stage.owningContext); childs.add(stage.owningContext);
...@@ -98,7 +98,7 @@ final class ConfigurationContext { ...@@ -98,7 +98,7 @@ final class ConfigurationContext {
} }
private void mergeContexts(final ConfigurationContext child) { private void mergeContexts(final ConfigurationContext child) {
threadService.merge(child.getRuntimeService()); threadService.merge(child.getThreadService());
// Finally copy parent services // Finally copy parent services
child.threadService = this.threadService; child.threadService = this.threadService;
...@@ -116,12 +116,12 @@ final class ConfigurationContext { ...@@ -116,12 +116,12 @@ final class ConfigurationContext {
this.threadService.onFinish(); this.threadService.onFinish();
} }
public ThreadService getRuntimeService() { ThreadService getThreadService() {
return threadService; return threadService;
} }
public void setRuntimeService(final ThreadService runtimeService) { void setThreadService(final ThreadService threadService) {
this.threadService = runtimeService; this.threadService = threadService;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment