Search in sources :

Example 1 with CoreModule

use of com.torodb.core.guice.CoreModule in project torodb by torodb.

the class BootstrapModule method configure.

@Override
protected void configure() {
    binder().requireExplicitBindings();
    install(new PackagingModule(clock));
    install(new CoreModule());
    install(new ExecutorServicesModule());
    install(new ConcurrentModule());
    install(new MetainfModule());
    install(new MetricsModule(config.getGeneric()));
    install(new BackendMultiImplementationModule(config.getProtocol().getMongo(), config.getGeneric(), config.getBackend().getBackendImplementation(), new BackendPostgresImplementationModule(), new BackendDerbyImplementationModule()));
    bind(Config.class).toInstance(config);
    bind(MongodServerConfig.class).toInstance(new MongodServerConfig(HostAndPort.fromParts("localhost", 27017)));
    bind(BuildProperties.class).to(DefaultBuildProperties.class).asEagerSingleton();
}
Also used : PackagingModule(com.torodb.packaging.guice.PackagingModule) ExecutorServicesModule(com.torodb.packaging.guice.ExecutorServicesModule) Config(com.torodb.standalone.config.model.Config) MongodServerConfig(com.torodb.mongodb.core.MongodServerConfig) BackendMultiImplementationModule(com.torodb.packaging.guice.BackendMultiImplementationModule) MetricsModule(com.torodb.core.metrics.guice.MetricsModule) BackendDerbyImplementationModule(com.torodb.packaging.guice.BackendDerbyImplementationModule) ConcurrentModule(com.torodb.concurrent.guice.ConcurrentModule) DefaultBuildProperties(com.torodb.packaging.DefaultBuildProperties) CoreModule(com.torodb.core.guice.CoreModule) MetainfModule(com.torodb.metainfo.guice.MetainfModule) BackendPostgresImplementationModule(com.torodb.packaging.guice.BackendPostgresImplementationModule) MongodServerConfig(com.torodb.mongodb.core.MongodServerConfig)

Example 2 with CoreModule

use of com.torodb.core.guice.CoreModule in project torodb by torodb.

the class OplogTestContextResourceRule method before.

@Override
protected void before() throws Throwable {
    testInjector = Guice.createInjector(new ReplTestModule(), new TorodServerTestModule(), new CoreModule(), new BackendModule(), new DerbyBackendModule(), new MetainfModule(), new D2RModule(), new MemoryTorodModule(), new MetricsModule(new MetricsConfig() {

        @Override
        public Boolean getMetricsEnabled() {
            return true;
        }
    }), new ConcurrentModule(), new MongoLayerModule(), new MongodServerTestModule(), specificModuleSupplier.get());
    torodServer = testInjector.getInstance(TorodBundle.class).getTorodServer();
    torodServer.startAsync();
    mongodServer = testInjector.getInstance(MongodServer.class);
    mongodServer.startAsync();
    mongodServer.awaitRunning();
    assert mongodServer.getTorodServer().equals(torodServer);
    torodServer.awaitRunning();
    oplogManager = testInjector.getInstance(OplogManager.class);
    oplogManager.startAsync();
    oplogManager.awaitRunning();
    aobe = testInjector.getInstance(AnalyzedOplogBatchExecutor.class);
    aobe.startAsync();
    aobe.awaitRunning();
    oplogApplier = testInjector.getInstance(OplogApplier.class);
    testContext = new DefaultOplogTestContext(mongodServer, oplogApplier);
}
Also used : AnalyzedOplogBatchExecutor(com.torodb.mongodb.repl.oplogreplier.batch.AnalyzedOplogBatchExecutor) MongoLayerModule(com.torodb.mongodb.guice.MongoLayerModule) D2RModule(com.torodb.d2r.guice.D2RModule) OplogManager(com.torodb.mongodb.repl.OplogManager) ConcurrentModule(com.torodb.concurrent.guice.ConcurrentModule) MetricsConfig(com.torodb.core.metrics.MetricsConfig) MetricsModule(com.torodb.core.metrics.guice.MetricsModule) CoreModule(com.torodb.core.guice.CoreModule) BackendModule(com.torodb.backend.guice.BackendModule) DerbyBackendModule(com.torodb.backend.derby.guice.DerbyBackendModule) MetainfModule(com.torodb.metainfo.guice.MetainfModule) MongodServer(com.torodb.mongodb.core.MongodServer) MemoryTorodModule(com.torodb.torod.guice.MemoryTorodModule) DerbyBackendModule(com.torodb.backend.derby.guice.DerbyBackendModule)

Example 3 with CoreModule

use of com.torodb.core.guice.CoreModule in project torodb by torodb.

the class BootstrapModule method configure.

@Override
protected void configure() {
    binder().requireExplicitBindings();
    install(new PackagingModule(clock));
    install(new CoreModule());
    install(new ExecutorServicesModule());
    install(new ConcurrentModule());
    install(new MetainfModule());
    install(new MetricsModule(config));
    install(getBackendMultiImplementationModule(config.getReplication(), config.getBackend().getPool(), config.getBackend().getBackendImplementation()));
    bind(Config.class).toInstance(config);
    bind(MongodServerConfig.class).toInstance(new MongodServerConfig(HostAndPort.fromParts("localhost", 27017)));
    bind(BuildProperties.class).to(DefaultBuildProperties.class).asEagerSingleton();
}
Also used : PackagingModule(com.torodb.packaging.guice.PackagingModule) ExecutorServicesModule(com.torodb.packaging.guice.ExecutorServicesModule) ConnectionPoolConfig(com.torodb.packaging.config.model.backend.ConnectionPoolConfig) Config(com.torodb.stampede.config.model.Config) MongodServerConfig(com.torodb.mongodb.core.MongodServerConfig) CursorConfig(com.torodb.packaging.config.model.backend.CursorConfig) MetricsModule(com.torodb.core.metrics.guice.MetricsModule) ConcurrentModule(com.torodb.concurrent.guice.ConcurrentModule) DefaultBuildProperties(com.torodb.packaging.DefaultBuildProperties) CoreModule(com.torodb.core.guice.CoreModule) MetainfModule(com.torodb.metainfo.guice.MetainfModule) MongodServerConfig(com.torodb.mongodb.core.MongodServerConfig)

Aggregations

ConcurrentModule (com.torodb.concurrent.guice.ConcurrentModule)3 CoreModule (com.torodb.core.guice.CoreModule)3 MetricsModule (com.torodb.core.metrics.guice.MetricsModule)3 MetainfModule (com.torodb.metainfo.guice.MetainfModule)3 MongodServerConfig (com.torodb.mongodb.core.MongodServerConfig)2 DefaultBuildProperties (com.torodb.packaging.DefaultBuildProperties)2 ExecutorServicesModule (com.torodb.packaging.guice.ExecutorServicesModule)2 PackagingModule (com.torodb.packaging.guice.PackagingModule)2 DerbyBackendModule (com.torodb.backend.derby.guice.DerbyBackendModule)1 BackendModule (com.torodb.backend.guice.BackendModule)1 MetricsConfig (com.torodb.core.metrics.MetricsConfig)1 D2RModule (com.torodb.d2r.guice.D2RModule)1 MongodServer (com.torodb.mongodb.core.MongodServer)1 MongoLayerModule (com.torodb.mongodb.guice.MongoLayerModule)1 OplogManager (com.torodb.mongodb.repl.OplogManager)1 AnalyzedOplogBatchExecutor (com.torodb.mongodb.repl.oplogreplier.batch.AnalyzedOplogBatchExecutor)1 ConnectionPoolConfig (com.torodb.packaging.config.model.backend.ConnectionPoolConfig)1 CursorConfig (com.torodb.packaging.config.model.backend.CursorConfig)1 BackendDerbyImplementationModule (com.torodb.packaging.guice.BackendDerbyImplementationModule)1 BackendMultiImplementationModule (com.torodb.packaging.guice.BackendMultiImplementationModule)1