|
ozone API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.AbstractDatabase
org.ozoneDB.ExternalDatabase
org.ozoneDB.ClientCacheDatabase
This is an ExternalDatabase
that implements a client side cache on
top of another ExternalDatabase
.
In contrast to LocalDatabase
and RemoteDatabase
which
produce the exactly same results for the same code, this implementation of
ExternalDatabase
is not guaranteed to do so.
Note: The method parameters of type OzoneRemote
are supposed to by
proxy objects (of type OzoneProxy
). However, it's possible to pass
a database objects (of type OzoneCompatible
). In this case the
parameter should be substituted. Currently this is done by the invoke()
method only.
Impl. Note: All interface methods are synchronized because they have to be executed as an atomar operation.
OzoneInterface
Field Summary |
Fields inherited from class org.ozoneDB.ExternalDatabase |
DefaultAccessRight, PROP_DEBUG, PROP_DIR, PROP_HOST, PROP_PASSWD, PROP_PORT, PROP_USER |
Fields inherited from interface org.ozoneDB.OzoneInterface |
AllLock, AllRead, GroupLock, GroupRead, Private, Public |
Constructor Summary | |
ClientCacheDatabase(ExternalDatabase _delegate)
Constructs a new ClientCacheDatabase with the given delegate as back-end. |
|
ClientCacheDatabase(ExternalDatabase _delegate,
boolean _debug)
Constructs a new ClientCacheDatabase with the given delegate as back-end and the given debug option. |
Method Summary | |
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.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. |
ExternalDatabase |
delegate()
|
void |
deleteObject(OzoneRemote obj)
Deletes the specified database object. |
OzoneCompatible |
fetch(OzoneProxy proxy,
int lockLevel)
Returns the actual target of the given proxy if the actual implementation is able to do so. |
long |
freeMemory()
Return the amount of *total* free memory in the system. |
java.lang.Object |
invoke(OzoneProxy proxy,
int methodIndex,
java.lang.Object[] args,
int lockLevel)
|
java.lang.Object |
invoke(OzoneProxy proxy,
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. |
OzoneProxy |
objectForName(java.lang.String name)
Returns the object for the specifies name or null if there is no such 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. |
Methods inherited from class org.ozoneDB.ExternalDatabase |
admin, createObject, createObject, createObject, createObject, createObject, createObject, createObject, createObject, createObject, currentExternalTransaction, currentTransaction, forThread, getStatusTX, getXAResource, notifyProxyDeath, objectForHandle, objectNames, openDatabase, openDatabase, xmlForObject, xmlForObject |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClientCacheDatabase(ExternalDatabase _delegate)
Note: The size of the client side cache can be adjusted via the heap size of the VM (parameter -Xmx). The cache uses all available heap in its VM.
_delegate
- The back-end database.public ClientCacheDatabase(ExternalDatabase _delegate, boolean _debug)
Note: The size of the client side cache can be adjusted via the heap size of the VM (parameter -Xmx). The cache uses all available heap in its VM.
_delegate
- The back-end database._debug
- Method Detail |
public ExternalDatabase delegate()
public boolean isOpen() throws java.lang.Exception
isOpen
in class ExternalDatabase
java.lang.Exception
public void close() throws java.lang.Exception
ExternalDatabase
close
in class ExternalDatabase
java.lang.Exception
public ExternalTransaction newTransaction()
ExternalDatabase
newTransaction
in class ExternalDatabase
public void beginTX(AbstractTransaction tx) throws TransactionException, java.io.IOException
ExternalDatabase
beginTX
in class ExternalDatabase
TransactionException
java.io.IOException
public void joinTX(AbstractTransaction tx) throws TransactionException
ExternalDatabase
joinTX
in class ExternalDatabase
TransactionException
public boolean leaveTX(AbstractTransaction tx)
ExternalDatabase
leaveTX
in class ExternalDatabase
public void checkpointTX(AbstractTransaction tx) throws TransactionException, java.io.IOException
ExternalDatabase
checkpointTX
in class ExternalDatabase
TransactionException
java.io.IOException
public void prepareTX(AbstractTransaction tx) throws TransactionException, java.io.IOException
ExternalDatabase
prepareTX
in class ExternalDatabase
TransactionException
java.io.IOException
public void commitTX(AbstractTransaction tx, boolean onePhase) throws TransactionException, java.io.IOException
ExternalDatabase
commitTX
in class ExternalDatabase
TransactionException
java.io.IOException
public void rollbackTX(AbstractTransaction tx) throws TransactionException, java.io.IOException
ExternalDatabase
rollbackTX
in class ExternalDatabase
TransactionException
java.io.IOException
public void reloadClasses() throws java.lang.Exception
reloadClasses
in interface OzoneInterface
reloadClasses
in class ExternalDatabase
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
OzoneInterface
createObject
in interface OzoneInterface
createObject
in class ExternalDatabase
java.lang.RuntimeException
public void deleteObject(OzoneRemote obj) throws java.lang.RuntimeException
OzoneInterface
deleteObject
in interface OzoneInterface
deleteObject
in class ExternalDatabase
java.lang.RuntimeException
public OzoneProxy copyObject(OzoneRemote obj) throws java.lang.Exception
OzoneInterface
copyObject
in interface OzoneInterface
copyObject
in class ExternalDatabase
java.lang.Exception
public void nameObject(OzoneRemote obj, java.lang.String name) throws java.lang.Exception
OzoneInterface
nameObject
in interface OzoneInterface
nameObject
in class ExternalDatabase
java.lang.Exception
public OzoneProxy objectForName(java.lang.String name) throws java.lang.Exception
OzoneInterface
objectForName
in interface OzoneInterface
objectForName
in class ExternalDatabase
java.lang.Exception
public java.lang.Object invoke(OzoneProxy proxy, java.lang.String methodName, java.lang.String sig, java.lang.Object[] args, int lockLevel) throws java.lang.Exception
OzoneInterface
invoke
in interface OzoneInterface
invoke
in class ExternalDatabase
java.lang.Exception
public java.lang.Object invoke(OzoneProxy proxy, int methodIndex, java.lang.Object[] args, int lockLevel) throws java.lang.Exception
invoke
in interface OzoneInterface
invoke
in class ExternalDatabase
java.lang.Exception
public OzoneCompatible fetch(OzoneProxy proxy, int lockLevel) throws java.lang.Exception, ObjectNotFoundException, java.io.IOException, java.lang.ClassNotFoundException, TransactionException, org.ozoneDB.core.TransactionError
OzoneInterface
fetch
in interface OzoneInterface
fetch
in class ExternalDatabase
java.lang.Exception
ObjectNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
TransactionException
org.ozoneDB.core.TransactionError
public long freeMemory()
Note: this will not work properly if some kind of weal references are used in this VM. In case of empty space we need to force teh GC to also free weak references.
|
ozone API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |