Search in sources :

Example 1 with BackendModule

use of com.torodb.backend.guice.BackendModule 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 2 with BackendModule

use of com.torodb.backend.guice.BackendModule in project torodb by torodb.

the class BackendImplementationModule method configure.

@Override
protected void configure() {
    install(new BackendModule());
    bind(configurationClass).toInstance(configurationClass.cast(backendImplementation));
    bind(backendConfigurationClass).to(backendConfigurationMapperClass);
    install(backendModuleSupplier.get());
    expose(SqlHelper.class);
    expose(SqlInterface.class);
    expose(SchemaUpdater.class);
    expose(DbBackendService.class);
    expose(IdentifierConstraints.class);
    expose(BackendBundleFactory.class);
    expose(BackendTransactionJobFactory.class);
    expose(ReservedIdGenerator.class);
    expose(SnapshotUpdater.class);
}
Also used : BackendModule(com.torodb.backend.guice.BackendModule)

Aggregations

BackendModule (com.torodb.backend.guice.BackendModule)2 DerbyBackendModule (com.torodb.backend.derby.guice.DerbyBackendModule)1 ConcurrentModule (com.torodb.concurrent.guice.ConcurrentModule)1 CoreModule (com.torodb.core.guice.CoreModule)1 MetricsConfig (com.torodb.core.metrics.MetricsConfig)1 MetricsModule (com.torodb.core.metrics.guice.MetricsModule)1 D2RModule (com.torodb.d2r.guice.D2RModule)1 MetainfModule (com.torodb.metainfo.guice.MetainfModule)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 MemoryTorodModule (com.torodb.torod.guice.MemoryTorodModule)1