io.sirix.access.DatabaseModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sirix-core Show documentation
Show all versions of sirix-core Show documentation
SirixDB is a hybrid on-disk and in-memory document oriented, versioned database system. It has a lightweight buffer manager, stores everything in a huge persistent and durable tree and allows efficient reconstruction of every revision. Furthermore, SirixDB implements change tracking, diffing and supports time travel queries.
package io.sirix.access;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import io.sirix.access.json.JsonLocalDatabaseComponent;
import io.sirix.access.json.LocalJsonDatabaseFactory;
import io.sirix.access.xml.LocalXmlDatabaseFactory;
import io.sirix.api.Database;
import io.sirix.api.ResourceSession;
import io.sirix.access.xml.XmlLocalDatabaseComponent;
import io.sirix.api.json.JsonResourceSession;
import io.sirix.api.xml.XmlResourceSession;
import javax.inject.Singleton;
/**
* The DI module that bridges interfaces to implementations.
*
* @author Joao Sousa
*/
@Module(subcomponents = { JsonLocalDatabaseComponent.class, XmlLocalDatabaseComponent.class})
public interface DatabaseModule {
@Binds
@Singleton
LocalDatabaseFactory bindJsonDatabaseFactory(LocalJsonDatabaseFactory jsonFactory);
@Binds
@Singleton
LocalDatabaseFactory bindXmlDatabaseFactory(LocalXmlDatabaseFactory xmlFactory);
@Provides
@Singleton
static PathBasedPool> databaseSessions() {
return new PathBasedPool<>();
}
@Provides
@Singleton
static PathBasedPool> resourceManagers() {
return new PathBasedPool<>();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy