Skip to content
Snippets Groups Projects
Commit 6fd1c841 authored by Jon Chambers's avatar Jon Chambers Committed by Jon Chambers
Browse files

Make command namespace available to subclasses

parent 0100f0fc
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ import reactor.core.scheduler.Schedulers; ...@@ -24,6 +24,7 @@ import reactor.core.scheduler.Schedulers;
public abstract class AbstractSinglePassCrawlAccountsCommand extends EnvironmentCommand<WhisperServerConfiguration> { public abstract class AbstractSinglePassCrawlAccountsCommand extends EnvironmentCommand<WhisperServerConfiguration> {
private CommandDependencies commandDependencies; private CommandDependencies commandDependencies;
private Namespace namespace;
private final Logger logger = LoggerFactory.getLogger(getClass()); private final Logger logger = LoggerFactory.getLogger(getClass());
...@@ -53,14 +54,19 @@ public abstract class AbstractSinglePassCrawlAccountsCommand extends Environment ...@@ -53,14 +54,19 @@ public abstract class AbstractSinglePassCrawlAccountsCommand extends Environment
return commandDependencies; return commandDependencies;
} }
protected Namespace getNamespace() {
return namespace;
}
@Override @Override
protected void run(final Environment environment, final Namespace namespace, protected void run(final Environment environment, final Namespace namespace,
final WhisperServerConfiguration configuration) throws Exception { final WhisperServerConfiguration configuration) throws Exception {
UncaughtExceptionHandler.register(); UncaughtExceptionHandler.register();
MetricsUtil.configureRegistries(configuration, environment); MetricsUtil.configureRegistries(configuration, environment);
commandDependencies = CommandDependencies.build(getName(), environment, configuration);
this.namespace = namespace;
this.commandDependencies = CommandDependencies.build(getName(), environment, configuration);
final int segments = Objects.requireNonNull(namespace.getInt(SEGMENT_COUNT)); final int segments = Objects.requireNonNull(namespace.getInt(SEGMENT_COUNT));
...@@ -75,7 +81,6 @@ public abstract class AbstractSinglePassCrawlAccountsCommand extends Environment ...@@ -75,7 +81,6 @@ public abstract class AbstractSinglePassCrawlAccountsCommand extends Environment
} finally { } finally {
commandStopListener.stop(); commandStopListener.stop();
} }
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment