|
db4o 6.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExtObjectContainer
extended functionality for the
ObjectContainer
interface.
Every db4o ObjectContainer
always is an ExtObjectContainer
so a cast is possible.
ObjectContainer.ext()
is a convenient method to perform the cast.
The ObjectContainer functionality is split to two interfaces to allow newcomers to
focus on the essential methods.
Method Summary | ||
---|---|---|
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. |
|
Db4oCollections |
collections()
returns the Db4oCollections interface to create or modify database-aware
collections for this ObjectContainer . |
|
Configuration |
configure()
returns the Configuration context for this ObjectContainer. |
|
java.lang.Object |
descend(java.lang.Object obj,
java.lang.String[] path)
returns a member at the specific path without activating intermediate objects. |
|
|
getByID(long ID)
returns the stored object for an internal ID. |
|
|
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 synchronisation lock. |
|
void |
migrateFrom(ObjectContainer objectContainer)
aids migration of objects between ObjectContainers. |
|
|
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. |
|
ReplicationProcess |
replicationBegin(ObjectContainer peerB,
ReplicationConflictHandler conflictHandler)
prepares for replication with another ObjectContainer . |
|
void |
set(java.lang.Object obj,
int depth)
deep update interface to store or update objects. |
|
boolean |
setSemaphore(java.lang.String name,
int waitForAvailability)
attempts to set a semaphore. |
|
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. |
Methods inherited from interface com.db4o.ObjectContainer |
---|
activate, close, commit, deactivate, delete, ext, get, query, query, query, query, query, rollback, set |
Method Detail |
---|
void backup(java.lang.String path) throws java.io.IOException
path
- a fully qualified path
java.io.IOException
void bind(java.lang.Object obj, long id)
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 togetID(java.lang.Object)
Db4oCollections collections()
Db4oCollections
interface to create or modify database-aware
collections for this ObjectContainer
.
Db4oCollections
interface for this ObjectContainer
.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)
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 ID
null
,
if no object is associated with this ID in this ObjectContainer
.Why activation?
<T> T getByUUID(Db4oUUID uuid)
Db4oUUID
.
Db4oUUID
for an
object use getObjectInfo(Object)
and ObjectInfo.getUUID()
.
uuid
- the UUID
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 object
0
, 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 object
ObjectInfo
Db4oDatabase identity()
Db4oDatabase
object for this ObjectContainer.
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)
ObjectContainer
.
obj
- to be testedtrue
if the passed object is stored.ReflectClass[] knownClasses()
java.lang.Object lock()
void migrateFrom(ObjectContainer objectContainer)
Defragment
operation. It is included in the default
implementation supplied in Defragment.java/Defragment.cs.
objectContainer
- the ObjectContainer
objects are to be migrated
from or null
to denote that migration is completed.<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.set(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 returned
void 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.ReplicationProcess replicationBegin(ObjectContainer peerB, ReplicationConflictHandler conflictHandler)
ObjectContainer
.
ObjectContainer
can only be involved in a replication
process with one other ObjectContainer
at the same time.ReplicationProcess
interface provides methods to commit
and to cancel the replication process.
peerB
- the ObjectContainer
to replicate with.conflictHandler
- the conflict handler for this ReplicationProcess.
Conflicts occur
whenever ReplicationProcess.replicate(Object)
is called with an
object that was modified in both ObjectContainers since the last
replication run between the two. Upon a conflict the
ReplicationConflictHandler.resolveConflict(ReplicationProcess, Object, Object)
method will be called in the conflict handler.
ReplicationProcess
interface for this replication process.void set(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 updatedObjectContainer.set(java.lang.Object)
boolean 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()
|
db4o 6.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |