org.ozoneDB.odmg
Class OzoneServerODMGDatabase

java.lang.Object
  |
  +--org.ozoneDB.odmg.OzoneServerODMGDatabase
All Implemented Interfaces:
Database, EnhDatabase

public class OzoneServerODMGDatabase
extends java.lang.Object
implements EnhDatabase

Implementation of the ODMG Database interface that is used inside the ozone server to give the ODMG database objects their environment and their interface to the database.

Version:
$Revision: 1.1 $Date: 2002/05/08 15:03:21 $
Author:
SMB

Field Summary
 
Fields inherited from interface org.odmg.Database
NOT_OPEN, OPEN_EXCLUSIVE, OPEN_READ_ONLY, OPEN_READ_WRITE
 
Constructor Summary
OzoneServerODMGDatabase()
           
 
Method Summary
 void bind(java.lang.Object object, java.lang.String name)
          Associate a name with an object and make it persistent.
 void close()
          Close the database.
 boolean containsObject(java.lang.Object obj)
           
 java.lang.Object createPersistent(java.lang.Class cl)
          Create a new persistent instance of the given class.
 void deletePersistent(java.lang.Object object)
          Deletes an object from the database.
protected  void finalize()
           
 java.lang.Object lookup(java.lang.String name)
          Lookup an object via its name.
 void makePersistent(java.lang.Object object)
          Make a transient object durable in the database.
protected  int mode()
           
 void open(java.lang.String _url, int _accessMode)
          Open this ODMG database.
 void unbind(java.lang.String name)
          Disassociate a name with an object
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OzoneServerODMGDatabase

public OzoneServerODMGDatabase()
Method Detail

mode

protected int mode()

open

public void open(java.lang.String _url,
                 int _accessMode)
          throws ODMGException
Open this ODMG database.

Specified by:
open in interface Database
Parameters:
_url - URL of the database (ozonedb:remote://host:port or ozonedb:local://datadir)
_accessMode - The access mode, which should be one of the static fields: OPEN_READ_ONLY, OPEN_READ_WRITE, or OPEN_EXCLUSIVE.
Throws:
ODMGException - The database could not be opened.

close

public void close()
           throws ODMGException
Description copied from interface: Database
Close the database. After you have closed a database, further attempts to access objects in the database will cause the exception DatabaseClosedException to be thrown. Some implementations may throw additional exceptions that are also derived from ODMGException.

Specified by:
close in interface Database
Throws:
ODMGException - Unable to close the database.

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
java.lang.Throwable

makePersistent

public void makePersistent(java.lang.Object object)
Description copied from interface: Database
Make a transient object durable in the database. It must be executed in the context of an open transaction. If the transaction in which this method is executed commits, then the object is made durable. If the transaction aborts, then the makePersistent operation is considered not to have been executed, and the target object is again transient. ClassNotPersistenceCapableException is thrown if the implementation cannot make the object persistent because of the type of the object.

Specified by:
makePersistent in interface Database
Parameters:
object - The object to make persistent.

createPersistent

public java.lang.Object createPersistent(java.lang.Class cl)
Description copied from interface: EnhDatabase
Create a new persistent instance of the given class. This method must be executed in the context of an open transaction. If the transaction in which this method is executed commits, then the object is made durable. ClassNotPersistenceCapableException is thrown if the implementation cannot make the object persistent because of the type of the object.

Specified by:
createPersistent in interface EnhDatabase

deletePersistent

public void deletePersistent(java.lang.Object object)
Description copied from interface: Database
Deletes an object from the database. It must be executed in the context of an open transaction. If the object is not persistent, then ObjectNotPersistent is thrown. If the transaction in which this method is executed commits, then the object is removed from the database. If the transaction aborts, then the deletePersistent operation is considered not to have been executed, and the target object is again in the database.

Specified by:
deletePersistent in interface Database
Parameters:
object - The object to delete.

bind

public void bind(java.lang.Object object,
                 java.lang.String name)
Description copied from interface: Database
Associate a name with an object and make it persistent. An object instance may be bound to more than one name. Binding a previously transient object to a name makes that object persistent.

Specified by:
bind in interface Database
Parameters:
object - The object to be named.
name - The name to be given to the object.

unbind

public void unbind(java.lang.String name)
            throws ObjectNameNotFoundException
Description copied from interface: Database
Disassociate a name with an object

Specified by:
unbind in interface Database
Parameters:
name - The name of an object.
Throws:
ObjectNameNotFoundException - No object exists in the database with that name.

lookup

public java.lang.Object lookup(java.lang.String name)
                        throws ObjectNameNotFoundException
Description copied from interface: Database
Lookup an object via its name.

Specified by:
lookup in interface Database
Parameters:
name - The name of an object.
Returns:
The object with that name.
Throws:
ObjectNameNotFoundException - There is no object with the specified name.
See Also:
ObjectNameNotFoundException

containsObject

public boolean containsObject(java.lang.Object obj)


Copyright © 2002 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.