use of com.bakdata.conquery.commands.StandaloneCommand in project conquery by bakdata.
the class Conquery method initialize.
@Override
public void initialize(Bootstrap<ConqueryConfig> bootstrap) {
final ObjectMapper confMapper = bootstrap.getObjectMapper();
Jackson.configure(confMapper);
confMapper.setConfig(confMapper.getDeserializationConfig().withView(InternalOnly.class));
// check for java compiler, needed for the class generation
if (ToolProvider.getSystemJavaCompiler() == null) {
throw new IllegalStateException("Conquery requires to be run on either a JDK or a ServerJRE");
}
// main config file is json
bootstrap.setConfigurationFactoryFactory(JsonConfigurationFactory::new);
bootstrap.addCommand(new ShardNode());
bootstrap.addCommand(new PreprocessorCommand());
bootstrap.addCommand(new CollectEntitiesCommand());
bootstrap.addCommand(new StandaloneCommand(this));
bootstrap.addCommand(new RecodeStoreCommand());
bootstrap.addCommand(new MigrateCommand());
((MutableInjectableValues) confMapper.getInjectableValues()).add(Validator.class, bootstrap.getValidatorFactory().getValidator());
// do some setup in other classes after initialization but before running a
// command
bootstrap.addBundle(new ConfiguredBundle<>() {
@Override
public void run(ConqueryConfig configuration, Environment environment) {
configuration.configureObjectMapper(environment.getObjectMapper());
}
@Override
public void initialize(Bootstrap<?> bootstrap) {
// Allow overriding of config from environment variables.
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), StringSubstitutor.createInterpolator()));
}
});
}
Aggregations