Search in sources :

Example 1 with DatabaseModule

use of com.walmartlabs.concord.db.DatabaseModule in project concord by walmartlabs.

the class MigrateDB method main.

public static void main(String[] args) throws Exception {
    EnvironmentSelector environmentSelector = new EnvironmentSelector();
    Config cfg = new ConfigurationProcessor("concord-server", environmentSelector.select()).process();
    Injector injector = Guice.createInjector(new WireModule(new SpaceModule(new URLClassSpace(MigrateDB.class.getClassLoader()), BeanScanning.CACHE), new OllieConfigurationModule("com.walmartlabs.concord.server", cfg), new DatabaseModule()));
    new MigrateDB().run(injector);
}
Also used : OllieConfigurationModule(com.walmartlabs.ollie.config.OllieConfigurationModule) WireModule(org.eclipse.sisu.wire.WireModule) EnvironmentSelector(com.walmartlabs.ollie.config.EnvironmentSelector) Config(com.typesafe.config.Config) Injector(com.google.inject.Injector) ConfigurationProcessor(com.walmartlabs.ollie.config.ConfigurationProcessor) DatabaseModule(com.walmartlabs.concord.db.DatabaseModule) URLClassSpace(org.eclipse.sisu.space.URLClassSpace) SpaceModule(org.eclipse.sisu.space.SpaceModule)

Example 2 with DatabaseModule

use of com.walmartlabs.concord.db.DatabaseModule in project concord by walmartlabs.

the class ServerModule method configure.

@Override
protected void configure() {
    install(new MetricModule());
    install(new DatabaseModule());
}
Also used : MetricModule(com.walmartlabs.concord.server.metrics.MetricModule) DatabaseModule(com.walmartlabs.concord.db.DatabaseModule)

Example 3 with DatabaseModule

use of com.walmartlabs.concord.db.DatabaseModule in project concord by walmartlabs.

the class ConcordModule method configure.

@Override
protected void configure() {
    install(new ConfigurationModule());
    install(new MetricModule());
    install(new DatabaseModule());
    install(new ResteasyModule());
    install(new ValidationModule());
}
Also used : MetricModule(com.walmartlabs.concord.server.metrics.MetricModule) DatabaseModule(com.walmartlabs.concord.db.DatabaseModule) ResteasyModule(org.sonatype.siesta.server.resteasy.ResteasyModule) ValidationModule(com.walmartlabs.concord.server.boot.validation.ValidationModule)

Example 4 with DatabaseModule

use of com.walmartlabs.concord.db.DatabaseModule in project concord by walmartlabs.

the class AbstractDaoTest method initDataSource.

@BeforeEach
public void initDataSource() {
    DatabaseConfiguration cfg = new DatabaseConfigurationImpl("jdbc:postgresql://localhost:5432/postgres", "postgres", "q1", 3);
    DatabaseModule db = new DatabaseModule(migrateDb);
    this.dataSource = db.appDataSource(cfg, new MetricRegistry(), Collections.singleton(new MainDBChangeLogProvider()));
    this.cfg = db.appJooqConfiguration(this.dataSource);
}
Also used : DatabaseConfiguration(com.walmartlabs.concord.db.DatabaseConfiguration) MetricRegistry(com.codahale.metrics.MetricRegistry) DatabaseModule(com.walmartlabs.concord.db.DatabaseModule) MainDBChangeLogProvider(com.walmartlabs.concord.db.MainDBChangeLogProvider) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

DatabaseModule (com.walmartlabs.concord.db.DatabaseModule)4 MetricModule (com.walmartlabs.concord.server.metrics.MetricModule)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 Injector (com.google.inject.Injector)1 Config (com.typesafe.config.Config)1 DatabaseConfiguration (com.walmartlabs.concord.db.DatabaseConfiguration)1 MainDBChangeLogProvider (com.walmartlabs.concord.db.MainDBChangeLogProvider)1 ValidationModule (com.walmartlabs.concord.server.boot.validation.ValidationModule)1 ConfigurationProcessor (com.walmartlabs.ollie.config.ConfigurationProcessor)1 EnvironmentSelector (com.walmartlabs.ollie.config.EnvironmentSelector)1 OllieConfigurationModule (com.walmartlabs.ollie.config.OllieConfigurationModule)1 SpaceModule (org.eclipse.sisu.space.SpaceModule)1 URLClassSpace (org.eclipse.sisu.space.URLClassSpace)1 WireModule (org.eclipse.sisu.wire.WireModule)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ResteasyModule (org.sonatype.siesta.server.resteasy.ResteasyModule)1