use of com.fathomdb.config.ConfigurationImpl in project platformlayer by platformlayer.
the class KeystoneCliContext method connect.
@Override
public void connect() throws Exception {
Properties properties = options.getConfigurationProperties();
ConfigurationImpl configuration = ConfigurationImpl.from(new File("."), properties);
List<Module> modules = Lists.newArrayList();
modules.add(new ConfigurationModule(configuration));
modules.add(new KeystoneJdbcModule());
modules.add(new NullMetricsModule());
this.injector = Guice.createInjector(modules);
}
use of com.fathomdb.config.ConfigurationImpl in project platformlayer by platformlayer.
the class ConfigurationModule method configure.
@Override
protected void configure() {
super.configure();
ConfigurationImpl configuration = getConfiguration();
// TODO: Do we really need this??
// configuration.bindProperties(binder());
bindListener(Matchers.any(), new ConfigurationTypeListener(configuration));
try {
doExplicitBindings(configuration);
} catch (ClassNotFoundException e) {
throw new IllegalStateException("Explicitly bound class not found during binding", e);
}
}
use of com.fathomdb.config.ConfigurationImpl in project platformlayer by platformlayer.
the class KeystoneUserServer method main.
public static void main(String[] args) throws Exception {
List<Module> modules = Lists.newArrayList();
ConfigurationModule configurationModule = new ConfigurationModule();
modules.add(configurationModule);
Discovery discovery = Discovery.build();
ConfigurationImpl configuration = configurationModule.getConfiguration();
Extensions extensions = new Extensions(configuration, discovery);
modules.add(new CacheModule());
modules.add(new GuiceAuthenticationConfig());
modules.add(new KeystoneJdbcModule());
modules.add(new KeystoneOpsUserModule());
modules.add(new CodahaleMetricsModule());
modules.add(new UserAuthServletModule(extensions));
Injector injector = Guice.createInjector(modules);
KeystoneUserServer server = injector.getInstance(KeystoneUserServer.class);
server.start(WellKnownPorts.PORT_PLATFORMLAYER_AUTH_USER);
}
use of com.fathomdb.config.ConfigurationImpl in project platformlayer by platformlayer.
the class StandaloneXaasWebserver method main.
public static void main(String[] args) {
try {
// Force GMT
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
Discovery discovery = Discovery.build();
ConfigurationImpl configuration = ConfigurationImpl.load();
Extensions extensions = new Extensions(configuration, discovery);
List<Module> modules = Lists.newArrayList();
modules.add(new NullMetricsModule());
modules.add(new GuiceXaasConfig(configuration));
modules.add(new ConfigurationModule(configuration));
modules.add(new CacheModule());
modules.add(new JdbcGuiceModule());
modules.add(new PlatformLayerServletModule(extensions));
modules.add(new PlatformlayerValidationModule());
Injector injector = extensions.createInjector(configuration, modules);
ResultSetMappersProvider provider = injector.getInstance(ResultSetMappersProvider.class);
provider.addAll(ItemEntity.class, TagEntity.class, SchedulerRecordEntity.class, JobEntity.class, JobExecutionEntity.class);
extensions.addEntities(provider);
StandaloneXaasWebserver server = injector.getInstance(StandaloneXaasWebserver.class);
// Temporary hack
if (args.length != 0) {
log.warn("Insert WAR onto root: " + args[0]);
File rootWar = new File(args[0]);
server.wars.put("/", rootWar);
}
if (!server.start()) {
log.error("Failed to start webserver");
System.exit(1);
}
} catch (Throwable e) {
log.error("Error in initialization", e);
System.exit(1);
}
}
Aggregations