|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--goodsjpi.Database
Class representing GOODS database connection
| Field Summary | |
protected int |
allocBufSize
|
protected goodsjpi.CacheManager |
cacheManager
|
protected static java.util.Hashtable |
connections
|
protected goodsjpi.IdentityHashtable |
notifications
|
protected goodsjpi.CondEvent |
onTransactionAbortEvent
|
static int |
PER_PROCESS_TRANSACTION
Transaction isolation levels. |
static int |
PER_THREAD_TRANSACTION
|
static goodsjpi.RawBinaryFactory |
rawBinaryFactory
Factory of raw binary objects which is used to pack/unpack raw binary objects |
protected goodsjpi.Storage[] |
storages
|
| Constructor Summary | |
Database()
Constructor of the database |
|
| Method Summary | |
protected void |
abortTransaction()
|
void |
attach()
Attach current thread to the database. |
void |
attach(java.lang.Object obj,
int sid)
Associate persistent capable object with particular storage. |
void |
close()
Close database connection |
static void |
closeAll()
Close all database active connections. |
static void |
closeAllDead()
Iterate through the listy of all active conenction and close ones associated with dead threads. |
protected goodsjpi.Storage |
createStorage(goodsjpi.Database db,
int id)
Create storage |
void |
detach()
Detach current thread fro the database |
protected void |
disconnected(int sid)
Handler of client server connection failure. |
static goodsjpi.Database |
getDatabase(java.lang.String cfgFileName)
Create or reuse existed connection from connection pool |
int |
getNumberOfStorages()
Get number of storages in the database |
goodsjpi.Persistent |
getObject(int storageId,
int oid)
Get object from the storage by OID |
goodsjpi.Persistent |
getObject(java.lang.String oid)
Parse oid into number and get that id from the first storage |
java.lang.Object |
getRoot()
Get root object of the first storage in the database |
java.lang.Object |
getRoot(int sid)
Get root of the specified storage |
long |
getSize(int sid)
Get size of the database file of the storage |
protected void |
handleError(java.lang.String text)
Error handler. |
protected void |
handleException(java.io.IOException x)
Error handler. |
void |
notifyOnModification(java.lang.Object obj,
goodsjpi.CondEvent event)
Register event to be signaled on object modification |
void |
notifyOnTransactionAbort(goodsjpi.CondEvent event)
Register event to be signaled when transaction is aborted by server |
boolean |
open(java.lang.String cfgFileName)
Open the database |
void |
setAllocBufferSize(int size)
Set buffer size for bulk alloc. |
void |
setIsolationLevel(int level)
Set isoaltion level |
void |
setRoot(int sid,
java.lang.Object root)
Set root object for the specified storage in the database |
void |
setRoot(java.lang.Object root)
Set root object for the first storage in the database |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected goodsjpi.Storage[] storages
protected goodsjpi.IdentityHashtable notifications
protected goodsjpi.CacheManager cacheManager
protected int allocBufSize
public static goodsjpi.RawBinaryFactory rawBinaryFactory
protected goodsjpi.CondEvent onTransactionAbortEvent
public static final int PER_PROCESS_TRANSACTION
public static final int PER_THREAD_TRANSACTION
protected static java.util.Hashtable connections
| Constructor Detail |
public Database()
| Method Detail |
public void attach()
public void detach()
public void setIsolationLevel(int level)
public static goodsjpi.Database getDatabase(java.lang.String cfgFileName)
public static void closeAll()
public static void closeAllDead()
public boolean open(java.lang.String cfgFileName)
cfgFileName - path to the configuration filepublic void close()
public int getNumberOfStorages()
public java.lang.Object getRoot()
public java.lang.Object getRoot(int sid)
public long getSize(int sid)
public void setRoot(java.lang.Object root)
root - root object
public void setRoot(int sid,
java.lang.Object root)
sid - storage identifierroot - root object
public void attach(java.lang.Object obj,
int sid)
obj - persistent capable objectsid - storage identifierpublic void setAllocBufferSize(int size)
size - bulk allocation buffer sizepublic goodsjpi.Persistent getObject(java.lang.String oid)
public goodsjpi.Persistent getObject(int storageId,
int oid)
storageId - storageoid - object identifer
null if not found
public void notifyOnModification(java.lang.Object obj,
goodsjpi.CondEvent event)
obj - inspected objectevent - event which will be signalled when object is modified by some other clientpublic void notifyOnTransactionAbort(goodsjpi.CondEvent event)
protected void handleError(java.lang.String text)
text - error messageprotected void handleException(java.io.IOException x)
x - IOException
protected goodsjpi.Storage createStorage(goodsjpi.Database db,
int id)
db - databaseid - storage idenrtifier
protected void disconnected(int sid)
sid - storage identifierprotected void abortTransaction()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||