public interface ExtObjectContainer extends ObjectContainer
ObjectContainer interface.
ObjectContainer
always is an ExtObjectContainer so a cast is possible.ObjectContainer.ext()
is a convenient method to perform the cast.| Modifier and Type | Method and Description |
|---|---|
void |
activate(java.lang.Object obj)
activates an object with the current activation strategy.
|
void |
backup(Storage targetStorage,
java.lang.String path)
backs up a database file of an open ObjectContainer.
|
void |
backup(java.lang.String path)
backs up a database file of an open ObjectContainer.
|
void |
bind(java.lang.Object obj,
long id)
binds an object to an internal object ID.
|
Configuration |
configure()
returns the Configuration context for this ObjectContainer.
|
void |
deactivate(java.lang.Object obj)
deactivates an object.
|
java.lang.Object |
descend(java.lang.Object obj,
java.lang.String[] path)
returns a member at the specific path without activating intermediate objects.
|
<T> T |
getByID(long ID)
returns the stored object for an internal ID.
|
<T> T |
getByUUID(Db4oUUID uuid)
returns a stored object for a
Db4oUUID. |
long |
getID(java.lang.Object obj)
returns the internal unique object ID.
|
ObjectInfo |
getObjectInfo(java.lang.Object obj)
returns the
ObjectInfo for a stored object. |
Db4oDatabase |
identity()
returns the Db4oDatabase object for this ObjectContainer.
|
boolean |
isActive(java.lang.Object obj)
tests if an object is activated.
|
boolean |
isCached(long ID)
tests if an object with this ID is currently cached.
|
boolean |
isClosed()
tests if this
ObjectContainer is closed. |
boolean |
isStored(java.lang.Object obj)
tests if an object is stored in this
ObjectContainer. |
ReflectClass[] |
knownClasses()
returns all class representations that are known to this
ObjectContainer because they have been used or stored.
|
java.lang.Object |
lock()
returns the main synchronization lock.
|
ObjectContainer |
openSession()
opens a new ObjectContainer on top of this ObjectContainer.
|
<T> T |
peekPersisted(T object,
int depth,
boolean committed)
returns a transient copy of a persistent object with all members set
to the values that are currently stored to the database.
|
void |
purge()
unloads all clean indices from memory and frees unused objects.
|
void |
purge(java.lang.Object obj)
unloads a specific object from the db4o reference mechanism.
|
GenericReflector |
reflector()
Return the reflector currently being used by db4objects.
|
void |
refresh(java.lang.Object obj,
int depth)
refreshs all members on a stored object to the specified depth.
|
void |
releaseSemaphore(java.lang.String name)
releases a semaphore, if the calling transaction is the owner.
|
boolean |
setSemaphore(java.lang.String name,
int waitForAvailability)
attempts to set a semaphore.
|
void |
store(java.lang.Object obj,
int depth)
deep update interface to store or update objects.
|
StoredClass |
storedClass(java.lang.Object clazz)
returns a
StoredClass meta information object. |
StoredClass[] |
storedClasses()
returns an array of all
StoredClass meta information objects. |
SystemInfo |
systemInfo()
returns the
SystemInfo for this ObjectContainer. |
long |
version()
returns the current transaction serial number.
|
activate, close, commit, deactivate, delete, ext, query, query, query, query, query, queryByExample, rollback, storevoid activate(java.lang.Object obj)
throws Db4oIOException,
DatabaseClosedException
Configuration.activationDepth() )
and all configured settings for ObjectClass.maximumActivationDepth(int)
and ObjectClass.maximumActivationDepth(int) will be respected.TransparentActivationSupport )
the parameter object will only be activated, if it does not implement
Activatable. All referenced members that do not implement
Activatable will also be activated. Any Activatable objects
along the referenced graph will break cascading activation.void deactivate(java.lang.Object obj)
obj - the object to be deactivated.void backup(java.lang.String path)
throws Db4oIOException,
DatabaseClosedException,
NotSupportedException
Storage used for backup is the one configured for this container.path - a fully qualified pathDatabaseClosedException - db4o database file was closed or failed to open.NotSupportedException - is thrown when the operation is not supported in current
configuration/environmentDb4oIOException - I/O operation failed or was unexpectedly interrupted.void backup(Storage targetStorage, java.lang.String path) throws Db4oIOException, DatabaseClosedException, NotSupportedException
targetStorage - the Storage to be used for backuppath - a fully qualified pathDatabaseClosedException - db4o database file was closed or failed to open.NotSupportedException - is thrown when the operation is not supported in current
configuration/environmentDb4oIOException - I/O operation failed or was unexpectedly interrupted.void bind(java.lang.Object obj,
long id)
throws InvalidIDException,
DatabaseClosedException
set(Object) is
necessary to update the stored object.getID(Object).obj - the object that is to be boundid - the internal id the object is to be bound toDatabaseClosedException - db4o database file was closed or failed to open.InvalidIDException - when the provided id is outside the scope of the
database IDs.getID(java.lang.Object)Configuration configure()
Db4o class, the global
Configuration context
is copied into the ObjectContainer. The
Configuration
can be modified individually for
each ObjectContainer without any effects on the global settings.Configuration the Configuration
context for this ObjectContainerDb4o.configure()java.lang.Object descend(java.lang.Object obj,
java.lang.String[] path)
obj - the parent object that is to be used as the starting point.path - an array of field names to navigate by<T> T getByID(long ID)
throws DatabaseClosedException,
InvalidIDException
getID(Object).
Objects will not be activated by this method. They will be returned in the
activation state they are currently in, in the local cache.ID - the internal IDnull,
if no object is associated with this ID in this ObjectContainer.DatabaseClosedException - db4o database file was closed or failed to open.InvalidIDException - when the provided id is outside the scope of the
file length.Why activation?<T> T getByUUID(Db4oUUID uuid) throws DatabaseClosedException, Db4oIOException
Db4oUUID.
Db4oUUID for an
object use getObjectInfo(Object) and ObjectInfo.getUUID().uuid - the UUIDDb4oIOException - I/O operation failed or was unexpectedly interrupted.DatabaseClosedException - db4o database file was closed or failed to open.Why activation?long getID(java.lang.Object obj)
ObjectContainer.
An object carries the same ID in every db4o session. Internal IDs can
be used to look up objects with the very fast
getByID method.getObjectInfo(Object), ObjectInfo.getUUID() and
getByUUID(Db4oUUID) for long-term external references to
objects.obj - any object0, if the passed
object is not stored in this ObjectContainer.ObjectInfo getObjectInfo(java.lang.Object obj)
ObjectInfo for a stored object.
ObjectContainer.obj - the stored objectObjectInfoDb4oDatabase identity()
boolean isActive(java.lang.Object obj)
isActive returns false if an object is not
stored within the ObjectContainer.obj - to be testedtrue if the passed object is active.boolean isCached(long ID)
ID - the internal IDboolean isClosed()
ObjectContainer is closed.
true if this ObjectContainer is closed.boolean isStored(java.lang.Object obj)
throws DatabaseClosedException
ObjectContainer.
obj - to be testedtrue if the passed object is stored.DatabaseClosedException - db4o database file was closed or failed to open.ReflectClass[] knownClasses()
java.lang.Object lock()
ObjectContainer openSession()
<T> T peekPersisted(T object,
int depth,
boolean committed)
committed parameter it is possible to specify,
whether the desired object should contain the committed values or the
values that were set by the running transaction with
ObjectContainer.store(java.lang.Object).
object - the object that is to be cloneddepth - the member depth to which the object is to be instantiatedcommitted - whether committed or set values are to be returnedvoid purge()
void purge(java.lang.Object obj)
purge(Object) is not
"known" to the ObjectContainer afterwards, so this method may also be
used to create multiple copies of objects.purge(Object) has
no influence on the persistence state of objects. "Purged" objects can be
reretrieved with queries.obj - the object to be removed from the reference mechanism.GenericReflector reflector()
void refresh(java.lang.Object obj,
int depth)
obj - the object to be refreshed.depth - the member depth
to which refresh is to cascade.void releaseSemaphore(java.lang.String name)
name - the name of the semaphore to be released.void store(java.lang.Object obj,
int depth)
ObjectContainer#set(Object),
this method allows a manual specification of the depth, the passed object is to be updated.obj - the object to be stored or updated.depth - the depth to which the object is to be updatedcom.db4o.ObjectContainer#setboolean setSemaphore(java.lang.String name,
int waitForAvailability)
ObjectContainers.
releaseSemaphore(java.lang.String)ObjectContainer.close()ObjectServer is
closed.ObjectContainer looses the connection and is timed
out.ObjectContainer.commit() or ObjectContainer.rollback().getID(Object)name - the name of the semaphore to be setwaitForAvailability - the time in milliseconds to wait for other
transactions to release the semaphore. The parameter may be zero, if
the method is to return immediately.true, if the semaphore could be set or if the
calling transaction already owned the semaphore.
false, if the semaphore is owned by another
transaction.StoredClass storedClass(java.lang.Object clazz)
StoredClass meta information object.
clazz - class name, Class object, or example object.StoredClass meta information object.StoredClass[] storedClasses()
StoredClass meta information objects.SystemInfo systemInfo()
SystemInfo for this ObjectContainer.
SystemInfo supplies methods that provide
information about system state and system settings of this
ObjectContainer.SystemInfo for this ObjectContainer.long version()