|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sourceforge.jemm.database.components.BaseDatabase
public abstract class BaseDatabase
| Field Summary | |
|---|---|
protected DefaultDBAtomicIntTypeHandler |
atomicIntHandler
|
protected DBClassHandler |
classHandler
|
protected DBClientRefHandler |
clientRefHandler
|
protected DatabaseDebugIF |
debugHandler
|
protected DBEnumHandler |
enumHandler
|
protected DBGarbageSweeper |
gcHandler
|
protected DefaultDBListTypeHandler |
listHandler
|
protected DefaultDBMapTypeHandler |
mapHandler
|
protected DBObjectHandler |
objectHandler
|
protected ObjectStatusListener |
objectStatusListener
|
protected DBRootHandler |
rootHandler
|
protected DefaultDBSetTypeHandler |
setHandler
|
protected StorageEngine |
storageEngine
|
protected java.util.Map<ClassId,TypeHandler> |
typeHandlers
|
protected DBUserLockHandler |
userLockHandler
|
| Constructor Summary | |
|---|---|
BaseDatabase(StorageEngine storageEngine,
GCMode gcMode)
|
|
| Method Summary | |
|---|---|
void |
acquireLock(ClientThreadId threadId,
ID jemmId)
Asynchronous request to acquire a lock. |
void |
clientDisconnect(ClientId clientId)
Notification that the given client has disconnected, this call is only used on multi-client servers, allowing the server to free up resources associated with the client. |
ClassInfo |
getClassInfo(ClientId clientId,
ClassId classId)
Returns the class information for the given class id. |
DatabaseDebugIF |
getDebugInterface()
Returns a debug interface for this database, or null if not available. |
EnumInfo |
getEnumInfo(ClientId clientId,
EnumId enumId)
Returns the information about the given enumeration. |
GetObjectResp |
getObject(ClientId clientId,
ID jemmId)
Retrieves an object's information from the database. |
ID |
getRoot(ClientId clientId,
java.lang.String rootName)
Returns the object stored in the persistent root called 'rootName' |
ID |
newObject(ClientId clientId,
ClassId classId)
Notification of a new user object creation by the client. |
TypeResponse<?> |
processTypeRequest(ClientId clientId,
ClassId classId,
ID objId,
TypeRequest<?> request)
Process a request from a jemm type implementation. |
void |
referenceCleared(ClientId clientId,
ID... ids)
Asynchronous notification that the client has de-referenced the given id. |
ClassId |
registerClass(ClientId clientId,
ClassInfo classInfo)
Register a user class. |
EnumId |
registerEnum(ClientId clientId,
EnumInfo enumInfo)
Register an enumerated type. |
void |
releaseLock(ClientThreadId threadId,
ID jemmId)
Release the given lock held by the thread. |
void |
removeLockAcquiredListener(ClientId clientId)
Remove a lock listener |
void |
setClientLockAcquiredListener(ClientId clientId,
LockAcquiredListener listener)
Register a lock listener |
void |
setRoot(ClientId clientId,
java.lang.String rootName,
ID newValue)
Set the persistent root reference to the given object. |
ID |
setRootIfNull(ClientId clientId,
java.lang.String rootName,
ID newValue)
Sets the persistent root reference to the given object, if the root is currently null. |
void |
shutdown()
|
ObjectSyncResp |
synchroniseObject(ClientId clientId,
ID objectId,
ObjectSyncData syncData)
Synchronise a client held object with the server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final DBClassHandler classHandler
protected final DBEnumHandler enumHandler
protected final DBObjectHandler objectHandler
protected final DBUserLockHandler userLockHandler
protected final DBRootHandler rootHandler
protected final DatabaseDebugIF debugHandler
protected final DBClientRefHandler clientRefHandler
protected final DBGarbageSweeper gcHandler
protected DefaultDBListTypeHandler listHandler
protected DefaultDBSetTypeHandler setHandler
protected DefaultDBMapTypeHandler mapHandler
protected DefaultDBAtomicIntTypeHandler atomicIntHandler
protected final ObjectStatusListener objectStatusListener
protected StorageEngine storageEngine
protected java.util.Map<ClassId,TypeHandler> typeHandlers
| Constructor Detail |
|---|
public BaseDatabase(StorageEngine storageEngine,
GCMode gcMode)
| Method Detail |
|---|
public void setClientLockAcquiredListener(ClientId clientId,
LockAcquiredListener listener)
Database
setClientLockAcquiredListener in interface DatabaseclientId - The id of the client registering for lock notifications.listener - The listener to register.
public void acquireLock(ClientThreadId threadId,
ID jemmId)
Database
acquireLock in interface DatabasethreadId - The requesting thread.jemmId - The id of the object to lock.
public ClassInfo getClassInfo(ClientId clientId,
ClassId classId)
Database
getClassInfo in interface DatabaseclientId - The id of the requesting client.classId - The id of the held class.
public EnumInfo getEnumInfo(ClientId clientId,
EnumId enumId)
Database
getEnumInfo in interface DatabaseclientId - The id of the requesting client.enumId - The id of the enumerated type.
public GetObjectResp getObject(ClientId clientId,
ID jemmId)
Database
getObject in interface DatabaseclientId - The id of the requesting client.jemmId - The id of the object to retrieve.
public ID getRoot(ClientId clientId,
java.lang.String rootName)
Database
getRoot in interface DatabaseclientId - The id of the requesting client.rootName - The name of the persistent root.
public ID newObject(ClientId clientId,
ClassId classId)
Database
newObject in interface DatabaseclientId - The id of the requesting client.classId - The class id of the new object (must be previously registered).
public void referenceCleared(ClientId clientId,
ID... ids)
Database
referenceCleared in interface DatabaseclientId - The client who is no longer referencing 'id'ids - The ID that has been de-referenced.
public ClassId registerClass(ClientId clientId,
ClassInfo classInfo)
throws StructureModifiedException
Database
registerClass in interface DatabaseclientId - The registering client.classInfo - The information about the loaded user class (name/fields).
StructureModifiedException - if the class has been modified
and the Database does not accept the change
public EnumId registerEnum(ClientId clientId,
EnumInfo enumInfo)
throws StructureModifiedException
Database
registerEnum in interface DatabaseclientId - The identity of the registering client.enumInfo - The EnumInfo describing the enumerated type.
StructureModifiedException - If a modification to the enum is detected.
public void releaseLock(ClientThreadId threadId,
ID jemmId)
Database
releaseLock in interface DatabasethreadId - The thread currently holding the lock.jemmId - The id of the object to release.public void removeLockAcquiredListener(ClientId clientId)
Database
removeLockAcquiredListener in interface DatabaseclientId - The lock listener to remove.
public void setRoot(ClientId clientId,
java.lang.String rootName,
ID newValue)
Database
setRoot in interface DatabaseclientId - The id of the requesting client.rootName - The name of the persistent root.newValue - The new value of the root.
public ID setRootIfNull(ClientId clientId,
java.lang.String rootName,
ID newValue)
Database
setRootIfNull in interface DatabaseclientId - The id of the requesting client.rootName - The name of the persistent root.newValue - The new value of the root.
public ObjectSyncResp synchroniseObject(ClientId clientId,
ID objectId,
ObjectSyncData syncData)
Database
synchroniseObject in interface DatabaseclientId - The id of the requesting client.objectId - The id of the object.syncData - The object synchronisation data (client version, updated fields)
public DatabaseDebugIF getDebugInterface()
Database
getDebugInterface in interface Databasepublic void shutdown()
public void clientDisconnect(ClientId clientId)
Database
clientDisconnect in interface DatabaseclientId - The id of the client that has disconnected.
public TypeResponse<?> processTypeRequest(ClientId clientId,
ClassId classId,
ID objId,
TypeRequest<?> request)
Database
processTypeRequest in interface DatabaseclientId - The id of the requesting client.classId - The id of the class making the request.objId - The target object.request - The request data.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||