|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
net.sf.jso.engine.JSOStorageController
Controller responsible for coordinating storage operations by several concurrent storage managers.
| Field Summary |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
JSOStorageController(java.util.Properties someProperties)
Constructs the controller. |
|
| Method Summary | |
void |
addSchemaListener(SchemaListener listener)
Starts sending schema events to a listener. |
void |
addStatusListener(StatusListener listener)
Starts sending status events to a listener. |
void |
addStorageListener(StorageListener listener)
Starts sending storage events to a listener. |
ClassDescriptor |
createClassDescriptor(java.lang.Class aClass)
Creates a class descriptor for a storable class. |
long |
createId()
Creates an unique identification within a database. |
protected void |
finalize()
Stops the controller. |
ClassDescriptor |
getClassDescriptor(java.lang.Class aClass)
Returns the descriptor for a storable class. |
java.util.Properties |
getConfigurationProperties()
Returns configuration properties. |
ControllerInfo |
getControllerInfo()
Gets storage control information. |
int |
getCurrentCycle()
Gets current garbage collection cycle. |
PID |
getCurrentPID()
Gets current storage partition's identification. |
LockInfo |
getLockInfo()
Gets transaction processing information. |
Status |
getStatus()
Gets controller's status. |
boolean |
isRemote()
Indicates if controller is running on another JVM. |
void |
lock(TID txid,
OID oid,
boolean exclusive,
long timeout)
Holds a lock for an object. |
void |
objectDeleted(StorageEvent event)
Called when an object is deleted. |
void |
objectStored(StorageEvent event)
Called when an object is stored. |
void |
registerManager(StorageManager manager)
Register a storage manager to receive events. |
void |
release(TID txid,
OID oid)
Releases the lock for an object |
void |
removeSchemaListener(SchemaListener listener)
Stops sending schema events to a listener. |
void |
removeStatusListener(StatusListener listener)
Stops sending status events to a listener. |
void |
removeStorageListener(StorageListener listener)
Stops sending storage events to a listener. |
static void |
safellyStop(StorageController aController)
Stops a storage controller without throwing any exceptions. |
void |
start()
Starts the controller. |
void |
stop()
Stops the controller. |
void |
transactionBegun(TransactionEvent event)
Called immediately after transaction beginning. |
void |
transactionCommit(TransactionEvent event)
Called immediately before transaction commit. |
void |
transactionFinished(TransactionEvent event)
Called immediately after transaction finish. |
void |
transactionRollback(TransactionEvent event)
Called immediately before transaction rollback. |
void |
unregisterManager(StorageManager manager)
Unregister a storage manager to receive events. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public JSOStorageController(java.util.Properties someProperties)
throws java.rmi.RemoteException
someProperties - Properties containing parameters to the controller.
The following properties can be used:
jso.database.url: A database url of the form
jdbc:subprotocol:subname.jso.database.user: The database user on whose behalf the
connections will be made.jso.database.password: The user's password.jso.database.properties: Name of a properties file
containing database properties.jso.controller.pool.size: The maximum number of connections
of the pool. If not specified unlimited connections are allowed.jso.garbage.collection.on: Indicates if garbage
collection is turned on. Allowed values are "yes" and "no". If not
specified the garbage collector is turned on by default.jso.garbage.partition.size: The size of a partition.
Specifies the maximum number of objects a (logical) partition can have.
If not specified the default size of 200 objects is used.jso.garbage.collection.interval: The interval between two
consecutive garbage collections, in minutes. If not specified the
default interval of 10 minutes is used.jso.controller.stop.retry: The interval, in milliseconds,
between two consecutive attempts of stopping controller while waiting
for managers to unregister. A default value of 500ms is used.jso.controller.stop.timeout: The timeout, in milliseconds,
for controller to stop, regardless of managers activity. Controllers
should have a stop timeout greater than managers. A default value of
10000ms is used..DatabaseInterface.set(Properties)| Method Detail |
public void start()
throws StorageException
start in interface StorageControllerStorageException
public void stop()
throws StorageException
stop in interface StorageControllerStorageExceptionpublic static void safellyStop(StorageController aController)
aController - Storage controller to be stopped.public java.util.Properties getConfigurationProperties()
getConfigurationProperties in interface StorageController
public long createId()
throws StorageException
createId in interface StorageControllerStorageException
public PID getCurrentPID()
throws StorageException
getCurrentPID in interface StorageControllerStorageExceptionpublic int getCurrentCycle()
getCurrentCycle in interface StorageControllerpublic ControllerInfo getControllerInfo()
getControllerInfo in interface StorageControllerpublic void registerManager(StorageManager manager)
registerManager in interface StorageControllermanager - Manager to be registered.public void unregisterManager(StorageManager manager)
unregisterManager in interface StorageControllermanager - Manager to be unregistered.public void objectStored(StorageEvent event)
objectStored in interface StorageListenerpublic void objectDeleted(StorageEvent event)
objectDeleted in interface StorageListenerpublic void addStorageListener(StorageListener listener)
addStorageListener in interface StorageControllerlistener - Listener to receive storage events.public void removeStorageListener(StorageListener listener)
removeStorageListener in interface StorageControllerlistener - Listener to stop receiving storage events.public Status getStatus()
getStatus in interface StorageControllerpublic boolean isRemote()
isRemote in interface StorageControllertrue if controller is running on another JVM;
false otherwise.public void addStatusListener(StatusListener listener)
addStatusListener in interface StorageControllerlistener - Listener to receive status events.public void removeStatusListener(StatusListener listener)
removeStatusListener in interface StorageControllerlistener - Listener to stop receiving status events.public void addSchemaListener(SchemaListener listener)
addSchemaListener in interface SchemaManagerlistener - Listener to receive schema events.public void removeSchemaListener(SchemaListener listener)
removeSchemaListener in interface SchemaManagerlistener - Listener to stop receiving schema events.
public ClassDescriptor getClassDescriptor(java.lang.Class aClass)
throws StorageException
getClassDescriptor in interface SchemaManageraClass - The class to which the descriptot should be returned.
StorageException
public ClassDescriptor createClassDescriptor(java.lang.Class aClass)
throws StorageException
createClassDescriptor in interface SchemaManageraClass - The class to which the descriptot should be created.
StorageExceptionpublic void transactionBegun(TransactionEvent event)
transactionBegun in interface TransactionListenerpublic void transactionCommit(TransactionEvent event)
transactionCommit in interface TransactionListenerpublic void transactionRollback(TransactionEvent event)
transactionRollback in interface TransactionListenerpublic void transactionFinished(TransactionEvent event)
transactionFinished in interface TransactionListener
public void lock(TID txid,
OID oid,
boolean exclusive,
long timeout)
throws TransactionTimeoutException
lock in interface LockManageroid - The OID of the object to be locked.exclusive - Informs if the lock should be exclusive.timeout - Number of milliseconds for timeout. Values lesser than 1
millisecond mean no timeout should be used.
TransactionTimeoutException
public void release(TID txid,
OID oid)
throws StorageException
release in interface LockManageroid - The OID of the object to be released.
StorageExceptionpublic LockInfo getLockInfo()
getLockInfo in interface LockManager
protected void finalize()
throws java.lang.Throwable
java.lang.Throwable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||