public final class BerkeleyStorage extends Object implements IBackend
IBackendReader
IBackendWriter
instances for the
Treetank Framework.
After all this class is implemented as a Singleton to hold one BerkeleyStorage
per
SessionConfiguration
.IBackend.IBackendFactory
Constructor and Description |
---|
BerkeleyStorage(Properties pProperties,
IDataFactory pDataFac,
IMetaEntryFactory pMetaFac,
IByteHandler.IByteHandlerPipeline pByteHandler)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closing this storage.
|
IByteHandler.IByteHandlerPipeline |
getByteHandler()
Getting the ByteHandlers associated with this Storage.
|
IBackendReader |
getReader()
Getting a reader.
|
IBackendWriter |
getWriter()
Getting a writer.
|
void |
initialize()
Initializing the storage.
|
String |
toString() |
boolean |
truncate()
Truncating a storage.
|
@Inject public BerkeleyStorage(Properties pProperties, IDataFactory pDataFac, IMetaEntryFactory pMetaFac, IByteHandler.IByteHandlerPipeline pByteHandler) throws TTIOException
pProperties
- not only the file associated with the databasepDataFac
- factory for the dataspMetaFac
- factory for meta bucketpByteHandler
- handling any bytesTTIOException
- of something odd happens while database-connectionpublic void initialize() throws TTIOException
initialize
in interface IBackend
TTIOException
public IBackendReader getReader() throws TTIOException
getReader
in interface IBackend
IBackendReader
instanceTTIOException
- if the initalisation failspublic IBackendWriter getWriter() throws TTIOException
getWriter
in interface IBackend
IBackendWriter
instanceTTIOException
- if the initalisation failspublic void close() throws TTIOException
close
in interface IBackend
TTIOException
- exception to be thrownspublic IByteHandler.IByteHandlerPipeline getByteHandler()
IBackend
getByteHandler
in interface IBackend
IByteHandler.IByteHandlerPipeline
transforming bytes before storagepublic boolean truncate() throws TTException
truncate
in interface IBackend
TTException
- if anything weird happensCopyright © 2013. All Rights Reserved.