org.sirix.access.SubComponentResourceManagerFactory 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 org.sirix.access;
import org.sirix.api.NodeReadOnlyTrx;
import org.sirix.api.NodeTrx;
import org.sirix.api.ResourceManager;
import org.sirix.cache.BufferManager;
import javax.inject.Provider;
import java.nio.file.Path;
/**
* A parameterizable resource manager factory that creates {@link ResourceManager} instances based on
* {@link GenericResourceManagerComponent a resource manager subcomponent}.
*
* @author Joao Sousa
*/
public class SubComponentResourceManagerFactory,
R extends ResourceManager extends NodeReadOnlyTrx, ? extends NodeTrx>>
implements ResourceManagerFactory {
private final Provider subComponentBuilder;
public SubComponentResourceManagerFactory(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 - 2025 Weber Informatics LLC | Privacy Policy