use of com.fathomdb.jdbc.JdbcGuiceModule 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);
}
}
use of com.fathomdb.jdbc.JdbcGuiceModule in project platformlayer by platformlayer.
the class KeystoneJdbcModule method configure.
@Override
protected void configure() {
bind(DataSource.class).toProvider(GuiceDataSourceProvider.bind("auth.jdbc.")).asEagerSingleton();
JdbcGuiceModule jdbcGuiceModule = new JdbcGuiceModule();
binder().install(jdbcGuiceModule);
bind(UserDatabase.class).to(JdbcUserRepository.class).asEagerSingleton();
bind(ResultSetMappers.class).toProvider(Providers.guicify(ResultSetMappersProvider.build(UserEntity.class, ProjectEntity.class, ServiceAccountEntity.class, UserProjectEntity.class, UserCertEntity.class)));
}
Aggregations