|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoodsjpi.Database
Class representing GOODS database connection
Field Summary | |
protected int |
allocBufSize
|
protected CacheManager |
cacheManager
|
protected static java.util.Hashtable |
connections
|
protected IdentityHashtable |
notifications
|
protected CondEvent |
onTransactionAbortEvent
|
static int |
PER_PROCESS_TRANSACTION
Transaction isolation levels. |
static int |
PER_THREAD_TRANSACTION
|
static RawBinaryFactory |
rawBinaryFactory
Factory of raw binary objects which is used to pack/unpack raw binary objects |
protected 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 Storage |
createStorage(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. |
CacheManager |
getCacheManager()
Get database cache manager. |
static Database |
getDatabase(java.lang.String cfgFileName)
Create or reuse existed connection from connection pool |
int |
getNumberOfStorages()
Get number of storages in the database |
Persistent |
getObject(int storageId,
int oid)
Get object from the storage by OID |
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,
CondEvent event)
Register event to be signaled on object modification |
void |
notifyOnTransactionAbort(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 Storage[] storages
protected IdentityHashtable notifications
protected CacheManager cacheManager
protected int allocBufSize
public static RawBinaryFactory rawBinaryFactory
protected 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 CacheManager getCacheManager()
public static 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)
sid
- storage identifierpublic long getSize(int sid)
sid
- storage identifierpublic void setRoot(java.lang.Object root)
root
- root objectpublic void setRoot(int sid, java.lang.Object root)
sid
- storage identifierroot
- root objectpublic void attach(java.lang.Object obj, int sid)
obj
- persistent capable objectsid
- storage identifierpublic void setAllocBufferSize(int size)
size
- bulk allocation buffer sizepublic Persistent getObject(java.lang.String oid)
public Persistent getObject(int storageId, int oid)
storageId
- storageoid
- object identifer
null
if not foundpublic void notifyOnModification(java.lang.Object obj, CondEvent event)
obj
- inspected objectevent
- event which will be signalled when object is modified by some other clientpublic void notifyOnTransactionAbort(CondEvent event)
protected void handleError(java.lang.String text)
text
- error messageprotected void handleException(java.io.IOException x)
x
- IOExceptionprotected Storage createStorage(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 |