|
ozone API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ozoneDB.AbstractDatabase | +--org.ozoneDB.ExternalDatabase
Base class for implementations of the OzoneInterface which are used from a client application to access an ozone.
Each thread is associated with a server connection. This connection is used if the thread is not associated with a transaction. Otherwise the connection of the transaction is used. So in case the thread has *joined* a transaction it does not use its own connection but the connection of the transaction. The prepare/commit/abort methods don't need to be called from the thread that is joined to the transaction.
Impl. note: The OzoneInterface methods don't need to be synchronized any longer because each threads has its own connection.
OzoneInterface
Field Summary | |
static int |
DefaultAccessRight
|
static java.lang.String |
PROP_DEBUG
|
static java.lang.String |
PROP_DIR
|
static java.lang.String |
PROP_HOST
|
static java.lang.String |
PROP_PASSWD
|
static java.lang.String |
PROP_PORT
|
static java.lang.String |
PROP_USER
|
Fields inherited from interface org.ozoneDB.OzoneInterface |
AllLock, AllRead, GroupLock, GroupRead, Private, Public |
Constructor Summary | |
ExternalDatabase()
|
Method Summary | |
org.ozoneDB.core.admin.Admin |
admin()
Return the administration object for this database. |
void |
beginTX(AbstractTransaction tx)
This method is never directly called from the client code. |
void |
checkpointTX(AbstractTransaction tx)
This method is never directly called from the client code. |
void |
close()
Close this database. |
void |
commitTX(AbstractTransaction tx,
boolean onePhase)
This method is never directly called from the client code. |
OzoneProxy |
copyObject(OzoneRemote obj)
Copy an object. |
OzoneProxy |
createObject(java.lang.Class type)
Creates a database object of the specified class without a name and with default permissions. |
OzoneProxy |
createObject(java.lang.Class type,
int access)
Creates a database object of the specified class without a name and with the specified access rights. |
OzoneProxy |
createObject(java.lang.Class type,
int access,
java.lang.String objName)
Creates a database object of the specified class with the specified name and the specified access rights. |
OzoneProxy |
createObject(java.lang.Class type,
int access,
java.lang.String objName,
java.lang.String sig,
java.lang.Object[] args)
Creates an object by calling the constructor with the specified signature with the specified parameters. |
OzoneProxy |
createObject(java.lang.Class type,
java.lang.String sig,
java.lang.Object[] args)
Creates an object by calling the constructor with the specified signature with the specified parameters and default permissions. |
OzoneProxy |
createObject(java.lang.String className)
Creates a database object of the specified class without a name and with default permissions. |
OzoneProxy |
createObject(java.lang.String className,
int access)
Creates a database object of the specified class without a name and with the specified access rights. |
OzoneProxy |
createObject(java.lang.String className,
int access,
java.lang.String objName)
Creates a database object of the specified class with the specified name and the specified access rights. |
OzoneProxy |
createObject(java.lang.String className,
int access,
java.lang.String name,
java.lang.String sig,
java.lang.Object[] args)
Creates an object by calling the constructor with the specified signature with the specified parameters. |
OzoneProxy |
createObject(java.lang.String className,
java.lang.String sig,
java.lang.Object[] args)
Creates an object by calling the constructor with the specified signature with the specified parameters and default permissions. |
ExternalTransaction |
currentExternalTransaction()
Obtain the ExternalTransaction that is assocaited to the
caller's thread or null, if there is no such transaction. |
AbstractTransaction |
currentTransaction()
Obtain the transaction that is assocaited to the caller's thread or null, if there is no such transaction. |
void |
deleteObject(OzoneRemote obj)
Deletes the specified database object. |
OzoneCompatible |
fetch(OzoneProxy rObj,
int lockLevel)
Returns the actual target of the given proxy if the actual implementation is able to do so. |
static ExternalDatabase |
forThread(java.lang.Thread _thread)
Static method to find a database connection that has an associated transaction that has been joined by the given thread. |
int |
getStatusTX(AbstractTransaction tx)
Obtain the _internal_ server status of this transaction. |
javax.transaction.xa.XAResource |
getXAResource()
Return a new XAResource for this database connection. |
java.lang.Object |
invoke(OzoneProxy rObj,
int methodIndex,
java.lang.Object[] args,
int lockLevel)
|
java.lang.Object |
invoke(OzoneProxy rObj,
java.lang.String methodName,
java.lang.String sig,
java.lang.Object[] args,
int lockLevel)
Invokes a method on the specified object. |
boolean |
isOpen()
|
void |
joinTX(AbstractTransaction tx)
This method is never directly called from the client code. |
boolean |
leaveTX(AbstractTransaction tx)
This method is never directly called from the client code. |
void |
nameObject(OzoneRemote obj,
java.lang.String name)
Assigns the specified object with the specified name. |
ExternalTransaction |
newTransaction()
Create a new transaction. |
void |
notifyProxyDeath(OzoneProxy proxy)
Internal method. |
OzoneProxy |
objectForHandle(java.lang.String handle)
Returns the object for the specified handle or null if there is no such object. |
OzoneProxy |
objectForName(java.lang.String name)
Returns the object for the specifies name or null if there is no such object. |
OzoneProxy[] |
objectsOfClass(java.lang.String name)
Gives all objects of the specified class as array. |
static ExternalDatabase |
openDatabase(java.lang.String _url)
Factory method that creates a new database object. |
static ExternalDatabase |
openDatabase(java.lang.String _url,
java.lang.String _username,
java.lang.String _passwd)
Factory method that creates a new database object. |
void |
prepareTX(AbstractTransaction tx)
This method is never directly called from the client code. |
void |
reloadClasses()
Force the database server to reload all classes which extend OzoneObject. |
void |
rollbackTX(AbstractTransaction tx)
This method is never directly called from the client code. |
void |
xmlForObject(OzoneRemote rObj,
org.xml.sax.ContentHandler ch)
Converts the specified object into XML. |
org.w3c.dom.Node |
xmlForObject(OzoneRemote rObj,
org.w3c.dom.Document domFactory)
Convert the specified object into XML. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ozoneDB.OzoneInterface |
createObject, createObject, createObject, createObject, createObject, createObject, createObject, createObject, createObject |
Field Detail |
public static final java.lang.String PROP_HOST
public static final java.lang.String PROP_PORT
public static final java.lang.String PROP_DIR
public static final java.lang.String PROP_USER
public static final java.lang.String PROP_PASSWD
public static final java.lang.String PROP_DEBUG
public static final int DefaultAccessRight
Constructor Detail |
public ExternalDatabase()
Method Detail |
public static ExternalDatabase forThread(java.lang.Thread _thread)
_thread
- The thread for which to find the corresponding database.
public final javax.transaction.xa.XAResource getXAResource()
public ExternalTransaction newTransaction()
public ExternalTransaction currentExternalTransaction()
ExternalTransaction
that is assocaited to the
caller's thread or null, if there is no such transaction. This does not
necessarily mean that there is no transaction associated to this
thread at all. For example there might be an XA transaction.
currentTransaction()
public AbstractTransaction currentTransaction()
XATransaction
.
currentExternalTransaction()
public void beginTX(AbstractTransaction tx) throws TransactionExc, java.io.IOException
TransactionExc
java.io.IOException
public void joinTX(AbstractTransaction tx) throws TransactionExc
TransactionExc
public boolean leaveTX(AbstractTransaction tx)
public void checkpointTX(AbstractTransaction tx) throws TransactionExc, java.io.IOException
TransactionExc
java.io.IOException
public void prepareTX(AbstractTransaction tx) throws TransactionExc, java.io.IOException
TransactionExc
java.io.IOException
public void commitTX(AbstractTransaction tx, boolean onePhase) throws TransactionExc, java.io.IOException
TransactionExc
java.io.IOException
public void rollbackTX(AbstractTransaction tx) throws TransactionExc, java.io.IOException
TransactionExc
java.io.IOException
public final int getStatusTX(AbstractTransaction tx) throws TransactionExc, java.io.IOException
Transaction
.This method is never directly called from the client code.
TransactionExc
java.io.IOException
public boolean isOpen() throws java.lang.Exception
java.lang.Exception
public static ExternalDatabase openDatabase(java.lang.String _url, java.lang.String _username, java.lang.String _passwd) throws java.lang.Exception
ExternalDatabase
or LocalDatabase
)
depends on the specified database URL. The returned database connection
is already open.
java.lang.Exception
public static ExternalDatabase openDatabase(java.lang.String _url) throws java.lang.Exception
ExternalDatabase
or LocalDatabase
)
depends on the specified database URL. The returned database connection
is already open.
java.lang.Exception
public void close() throws java.lang.Exception
java.lang.Exception
public void reloadClasses() throws java.lang.Exception
OzoneInterface
reloadClasses
in interface OzoneInterface
java.lang.Exception
public OzoneProxy createObject(java.lang.String className, int access, java.lang.String name, java.lang.String sig, java.lang.Object[] args) throws java.lang.RuntimeException, ExceptionInOzoneObjectException
OzoneInterface
createObject
in interface OzoneInterface
className
- fully qualified name of the classaccess
- access right (ORed)name
- name of the object (optionalsig
- The signature string of the constructor.args
- The parameter that are passed to the constructor.
java.lang.RuntimeException
ExceptionInOzoneObjectException
public void deleteObject(OzoneRemote obj) throws java.lang.RuntimeException, ExceptionInOzoneObjectException
OzoneInterface
deleteObject
in interface OzoneInterface
obj
-
java.lang.RuntimeException
ExceptionInOzoneObjectException
public OzoneProxy copyObject(OzoneRemote obj) throws java.lang.Exception
OzoneInterface
copyObject
in interface OzoneInterface
obj
-
java.lang.Exception
public void nameObject(OzoneRemote obj, java.lang.String name) throws java.lang.Exception
OzoneInterface
nameObject
in interface OzoneInterface
obj
- name
-
java.lang.Exception
public OzoneProxy objectForName(java.lang.String name) throws java.lang.Exception
OzoneInterface
objectForName
in interface OzoneInterface
java.lang.Exception
public OzoneProxy objectForHandle(java.lang.String handle) throws java.lang.Exception
OzoneInterface
objectForHandle
in interface OzoneInterface
java.lang.Exception
public OzoneProxy[] objectsOfClass(java.lang.String name) throws java.lang.Exception
OzoneInterface
objectsOfClass
in interface OzoneInterface
name
-
java.lang.Exception
public java.lang.Object invoke(OzoneProxy rObj, java.lang.String methodName, java.lang.String sig, java.lang.Object[] args, int lockLevel) throws java.lang.Exception
OzoneInterface
invoke
in interface OzoneInterface
rObj
- OzoneProxy on which to call the methodmethodName
- sig
- signature of the method as Stringargs
- array of arguments
java.lang.Exception
public java.lang.Object invoke(OzoneProxy rObj, int methodIndex, java.lang.Object[] args, int lockLevel) throws java.lang.Exception
invoke
in interface OzoneInterface
java.lang.Exception
public OzoneCompatible fetch(OzoneProxy rObj, int lockLevel) throws java.lang.Exception
OzoneInterface
fetch
in interface OzoneInterface
java.lang.Exception
public org.w3c.dom.Node xmlForObject(OzoneRemote rObj, org.w3c.dom.Document domFactory) throws java.lang.Exception
OzoneInterface
OzoneInterface.xmlForObject(OzoneRemote, ContentHandler)
, which
returns SAX events, instead of DOM.
See the doc directory of ozone for a detailed description (XML Schema)
of the XML output of this method.
xmlForObject
in interface OzoneInterface
rObj
- The database object to be converted.
java.lang.Exception
public void xmlForObject(OzoneRemote rObj, org.xml.sax.ContentHandler ch) throws java.lang.Exception
OzoneInterface
xmlForObject
in interface OzoneInterface
rObj
- The database object to be converted.ch
- The SAX ContentHandler to which the result is sent.
java.lang.Exception
public org.ozoneDB.core.admin.Admin admin() throws java.lang.Exception
java.lang.Exception
public void notifyProxyDeath(OzoneProxy proxy)
OzoneProxy
s when they are dying (during finalize()). This
is required, as the database may track the references the database client has to objects within the database
in order to properly support garbage collection. If this method is called from anyone else than from the
OzoneProxy
.finalize()-Method, data loss may occur!
notifyProxyDeath
in interface OzoneInterface
proxy
- the OzoneProxy object which is dying. It may call this method exaclty once.public OzoneProxy createObject(java.lang.String className) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
className
- The fully qualified name of the class.
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.String className, int access) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
className
- The fully qualified name of the class.access
- The access rights (ORed).
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.String className, int access, java.lang.String objName) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
className
- The fully qualified name of the class.access
- The access right. (ORed)objName
- The name of the object. (optional)
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.String className, java.lang.String sig, java.lang.Object[] args) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
className
- fully qualified name of the classsig
- The signature string of the constructor.args
- The parameter that are passed to the constructor.
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.Class type) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
type
- the type of the object to be created
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.Class type, int access) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
type
- the type of the object to be createdaccess
- The access rights (ORed).
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.Class type, int access, java.lang.String objName) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
type
- the type of the object to be createdaccess
- The access right. (ORed)objName
- The name of the object. (optional)
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.Class type, int access, java.lang.String objName, java.lang.String sig, java.lang.Object[] args) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
type
- the type of the object to be createdaccess
- access right (ORed)objName
- name of the object (optionalsig
- The signature string of the constructor.args
- The parameter that are passed to the constructor.
java.lang.RuntimeException
public OzoneProxy createObject(java.lang.Class type, java.lang.String sig, java.lang.Object[] args) throws java.lang.RuntimeException
OzoneInterface
createObject
in interface OzoneInterface
type
- the type of the object to be createdsig
- The signature string of the constructor.args
- The parameter that are passed to the constructor.
java.lang.RuntimeException
|
ozone API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |