io.sirix.access.SubComponentResourceSessionFactory 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 io.sirix.cache.BufferManager;
import io.sirix.api.NodeReadOnlyTrx;
import io.sirix.api.NodeTrx;
import io.sirix.api.ResourceSession;
import javax.inject.Provider;
import java.nio.file.Path;
/**
* A parameterizable resource session factory that creates {@link ResourceSession} instances based on
* {@link GenericResourceSessionComponent a resource session subcomponent}.
*
* @author Joao Sousa
*/
public class SubComponentResourceSessionFactory, R extends ResourceSession extends NodeReadOnlyTrx, ? extends NodeTrx>>
implements ResourceSessionFactory {
private final Provider subComponentBuilder;
public SubComponentResourceSessionFactory(final Provider subComponentBuilder) {
this.subComponentBuilder = subComponentBuilder;
}
@Override
public R create(final ResourceConfiguration resourceConfig, final BufferManager bufferManager,
final Path resourceFile) {
return this.subComponentBuilder.get()
.resourceConfig(resourceConfig)
.bufferManager(bufferManager)
.resourceFile(resourceFile)
.build()
.resourceManager();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy