Package com.db4o.internal
Class IoAdaptedObjectContainer
- java.lang.Object
-
- com.db4o.internal.ObjectContainerBase
-
- com.db4o.internal.ExternalObjectContainer
-
- com.db4o.internal.LocalObjectContainer
-
- com.db4o.internal.IoAdaptedObjectContainer
-
- All Implemented Interfaces:
EmbeddedObjectContainer,ExtObjectContainer,InternalObjectContainer,ObjectContainerSpec,Internal4,ObjectContainer,TransientClass
public class IoAdaptedObjectContainer extends LocalObjectContainer implements EmbeddedObjectContainer
-
-
Field Summary
-
Fields inherited from class com.db4o.internal.LocalObjectContainer
_fileHeader, _pointerIo
-
Fields inherited from class com.db4o.internal.ObjectContainerBase
_blockConverter, _classCollection, _config, _handlers, _lock, _timeStampIdGenerator, _transaction
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbackup(Storage targetStorage, java.lang.String path)backs up a database file of an open ObjectContainer.voidbackupSync(Storage targetStorage, java.lang.String path)backs up a database file of an open ObjectContainer.byteblockSize()voidblockSize(int size)voidcloseTransaction(Transaction transaction, boolean isSystemTransaction, boolean rollbackOnClose)voidcommit1(Transaction trans)protected voidfatalStorageShutdown()longfileLength()java.lang.StringfileName()protected voidopenImpl()voidoverwriteDeletedBytes(int address, int length)voidreadBytes(byte[] bytes, int address, int length)voidreadBytes(byte[] bytes, int address, int addressOffset, int length)voidreserve(int byteCount)protected voidshutdownDataStorage()voidsyncFiles()voidsyncFiles(java.lang.Runnable runnable)BlockAwareBintimerFile()voidwriteBytes(ByteArrayBuffer buffer, int blockedAddress, int addressOffset)-
Methods inherited from class com.db4o.internal.LocalObjectContainer
allocatePointerSlot, allocateSafeSlot, allocateSlot, allocateSlotForNewUserObject, allocateSlotForUserObjectUpdate, appendBytes, blockSizeReadFromFile, classOnlyQuery, close2, closeIdSystem, commitHook, commitTransaction, converterVersion, createBTreeClassIndex, createIdSystem, currentVersion, debugReadPointerSlot, defaultToString, delete4, doFinalize, executeQuery, free, free, freespaceManager, from, generateNewIdentity, getAll, getFileHeader, getIDsForClass, identity, idForNewUserObject, idSystem, installDebugFreespaceManager, instanceCount, isDeleted, isValidPointer, localSystemTransaction, maximumDatabaseFileSize, newEventRegistry, newQueryResult, newQueryResult, newTransaction, newTransactionalIdSystem, openSession, overwriteDeletedBlockedSlot, queryAllObjects, raiseCommitTimestamp, readBufferById, readBufferById, readBufferBySlot, readPointerSlot, readSlotBuffers, readStatefulBufferById, readStatefulBufferById, readStatefulBufferBySlot, releaseSemaphore, releaseSemaphore, releaseSemaphores, rollback1, setDirtyInSystemTransaction, setIdentity, setNextTimeStampId, setRegularEndAddress, setSemaphore, setSemaphore, setServer, shutdown, systemData, systemInfo, writeDirtyClassMetadata, writeEncrypt, writeHeader, writeNew, writePointer, writeTransactionPointer, writeUpdate
-
Methods inherited from class com.db4o.internal.ExternalObjectContainer
activate, activate, bind, commit, deactivate, deactivate, delete, descend, ext, getByID, getByUUID, getID, getObjectInfo, inCallback, isActive, isCached, isStored, peekPersisted, purge, query, query, query, query, queryByExample, refresh, rollback, store, store, storedClass, storedClasses
-
Methods inherited from class com.db4o.internal.ObjectContainerBase
activate, activate, activationContextFor, activationDepthProvider, applyRenames, asTopLevelCall, backup, backupSync, bind, bind2, blockConverter, callbacks, callbacks, checkClosed, checkReadOnly, checkStillToSet, checkTransaction, checkTransaction, classCollection, classMetadataForID, classMetadataForName, classMetadataForObject, classMetadataForReflectClass, classMetadataIdForName, close, closeSystemTransaction, closeUserTransaction, commit, commitTimestampIndex, config, configImpl, configure, container, createBlockConverter, createClassMetadata, createReferenceSystem, createStatefulBuffer, createStringIO, db4oTypeStored, deactivate, deactivate, decryptedBufferByAddress, defaultActivationDepth, delete, delete1, delete2, deleteByID, detectSchemaChanges, dispatchsEvents, environment, fatalShutdown, finalize, flagAsHandled, generateTimeStampId, generateTransactionTimestamp, getActivatedObjectFromCache, getByID, getByID2, getByUUID, getHardObjectReferenceById, getHardReferenceBySignature, getID, getNativeQueryHandler, getObjectInfo, handledInCurrentTopLevelCall, handleExceptionOnClose, handlers, hasShutDownHook, initalizeWeakReferenceSupport, initialize1, initializeClassMetadataRepository, initializePostOpenExcludingTransportObjectContainer, initializeTransactions, isCached, isClient, isClosed, isStored, knownClasses, lock, logMsg, maintainsIndices, needsLockFileThread, needsUpdate, newSystemTransaction, newUserTransaction, newWeakReference, open, peekPersisted, peekPersisted, peekReference, produceClassMetadata, purge, purge, query, query, query, query, query, queryByExample, rawBufferByAddress, readActivatedObjectNotInCache, readWriterByAddress, referenceSystemRegistry, reflector, refresh, refreshInternal, replaceClassMetadataRepository, replicationCallState, rollback, send, showInternalClasses, shutdownObjectContainer, stackDepth, stackDepth, stillToActivate, stillToDeactivate, stopSession, store, store, store2, storeAfterReplication, storeAll, storeAll, storeByNewReplication, storedClass, storedClasses, storeInternal, storeInternal, stringIO, syncExec, systemTransaction, threadPool, topLevelCallId, topLevelCallId, toString, transaction, tryGetByID, typeHandlerForClass, typeHandlerForClassMetadataID, updateDepthProvider, useDefaultTransactionTimestamp, uUIDIndex, version, versionIndex, withEnvironment, withTransaction
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.db4o.EmbeddedObjectContainer
backup
-
Methods inherited from interface com.db4o.ext.ExtObjectContainer
activate, backup, backupSync, bind, configure, deactivate, descend, getByID, getByUUID, getID, getObjectInfo, isActive, isCached, isClosed, isStored, knownClasses, lock, peekPersisted, purge, purge, reflector, refresh, store, storedClass, storedClasses, version
-
Methods inherited from interface com.db4o.internal.InternalObjectContainer
callbacks, callbacks, classMetadataForID, classMetadataForName, classMetadataForReflectClass, configImpl, container, getNativeQueryHandler, handlers, inCallback, isClient, storeAll, syncExec, transaction, updateDepthProvider
-
Methods inherited from interface com.db4o.ObjectContainer
activate, close, commit, deactivate, delete, ext, query, query, query, query, query, queryByExample, rollback, store
-
-
-
-
Method Detail
-
openImpl
protected final void openImpl() throws OldFormatException, DatabaseReadOnlyException- Specified by:
openImplin classObjectContainerBase- Throws:
OldFormatExceptionDatabaseReadOnlyException
-
backup
public void backup(Storage targetStorage, java.lang.String path) throws DatabaseClosedException, Db4oIOException
Description copied from interface:ExtObjectContainerbacks up a database file of an open ObjectContainer.
While the backup is running, the ObjectContainer can continue to be used. Changes that are made while the backup is in progress, will be applied to the open ObjectContainer and to the backup.
While the backup is running, the ObjectContainer should not be closed.
Note that this is designed to run as a background process: To avoid harming performance of concurrently active database operations, it tries to leave room for other threads as much as possible and thus will be orders of magnitude slower than a regular file copy. If you are looking for a faster backup (that will block all other database operations), useExtObjectContainer.backupSync(Storage, String)instead.
If a file already exists at the specified path, it will be overwritten.
This method is intended for cross-storage backups, i.e. backup from an in-memory database to a file.- Specified by:
backupin interfaceExtObjectContainer- Specified by:
backupin classExternalObjectContainer- Parameters:
targetStorage- theStorageto be used for backuppath- a fully qualified path- Throws:
DatabaseClosedException- db4o database file was closed or failed to open.Db4oIOException- I/O operation failed or was unexpectedly interrupted.
-
backupSync
public void backupSync(Storage targetStorage, java.lang.String path) throws DatabaseClosedException, Db4oIOException
Description copied from interface:ExtObjectContainerbacks up a database file of an open ObjectContainer. While the backup is running, the ObjectContainer should not be closed.
Note that this blocks all other concurrently active database operations for the full duration of the backup. If you intend to run a backup as a less intrusive background process concurrently with other database operations, useExtObjectContainer.backup(Storage, String)instead.
If a file already exists at the specified path, it will be overwritten.
This method can be used for cross-storage backups, i.e. backup from an in-memory database to a file.- Specified by:
backupSyncin interfaceExtObjectContainer- Specified by:
backupSyncin classExternalObjectContainer- Parameters:
targetStorage- theStorageto be used for backuppath- a fully qualified path- Throws:
DatabaseClosedException- db4o database file was closed or failed to open.Db4oIOException- I/O operation failed or was unexpectedly interrupted.
-
blockSize
public void blockSize(int size)
- Specified by:
blockSizein classObjectContainerBase
-
blockSize
public byte blockSize()
- Specified by:
blockSizein classObjectContainerBase
-
shutdownDataStorage
protected void shutdownDataStorage()
- Specified by:
shutdownDataStoragein classObjectContainerBase
-
closeTransaction
public void closeTransaction(Transaction transaction, boolean isSystemTransaction, boolean rollbackOnClose)
- Specified by:
closeTransactionin classObjectContainerBase
-
commit1
public void commit1(Transaction trans)
- Overrides:
commit1in classLocalObjectContainer
-
fileLength
public long fileLength()
- Specified by:
fileLengthin classLocalObjectContainer
-
fileName
public java.lang.String fileName()
- Specified by:
fileNamein classLocalObjectContainer
-
readBytes
public void readBytes(byte[] bytes, int address, int length) throws Db4oIOException- Specified by:
readBytesin classObjectContainerBase- Throws:
Db4oIOException
-
readBytes
public void readBytes(byte[] bytes, int address, int addressOffset, int length) throws Db4oIOException- Specified by:
readBytesin classObjectContainerBase- Throws:
Db4oIOException
-
reserve
public void reserve(int byteCount) throws DatabaseReadOnlyException- Specified by:
reservein classObjectContainerBase- Throws:
DatabaseReadOnlyException
-
syncFiles
public void syncFiles()
- Specified by:
syncFilesin classLocalObjectContainer
-
syncFiles
public void syncFiles(java.lang.Runnable runnable)
- Specified by:
syncFilesin classLocalObjectContainer
-
writeBytes
public void writeBytes(ByteArrayBuffer buffer, int blockedAddress, int addressOffset)
- Specified by:
writeBytesin classLocalObjectContainer
-
overwriteDeletedBytes
public void overwriteDeletedBytes(int address, int length)- Specified by:
overwriteDeletedBytesin classLocalObjectContainer
-
timerFile
public BlockAwareBin timerFile()
-
fatalStorageShutdown
protected void fatalStorageShutdown()
- Specified by:
fatalStorageShutdownin classObjectContainerBase
-
-