|
|||||||||||
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 StorageController
StorageException
public void stop() throws StorageException
stop
in interface StorageController
StorageException
public 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 StorageController
StorageException
public PID getCurrentPID() throws StorageException
getCurrentPID
in interface StorageController
StorageException
public int getCurrentCycle()
getCurrentCycle
in interface StorageController
public ControllerInfo getControllerInfo()
getControllerInfo
in interface StorageController
public void registerManager(StorageManager manager)
registerManager
in interface StorageController
manager
- Manager to be registered.public void unregisterManager(StorageManager manager)
unregisterManager
in interface StorageController
manager
- Manager to be unregistered.public void objectStored(StorageEvent event)
objectStored
in interface StorageListener
public void objectDeleted(StorageEvent event)
objectDeleted
in interface StorageListener
public void addStorageListener(StorageListener listener)
addStorageListener
in interface StorageController
listener
- Listener to receive storage events.public void removeStorageListener(StorageListener listener)
removeStorageListener
in interface StorageController
listener
- Listener to stop receiving storage events.public Status getStatus()
getStatus
in interface StorageController
public boolean isRemote()
isRemote
in interface StorageController
true
if controller is running on another JVM;
false
otherwise.public void addStatusListener(StatusListener listener)
addStatusListener
in interface StorageController
listener
- Listener to receive status events.public void removeStatusListener(StatusListener listener)
removeStatusListener
in interface StorageController
listener
- Listener to stop receiving status events.public void addSchemaListener(SchemaListener listener)
addSchemaListener
in interface SchemaManager
listener
- Listener to receive schema events.public void removeSchemaListener(SchemaListener listener)
removeSchemaListener
in interface SchemaManager
listener
- Listener to stop receiving schema events.public ClassDescriptor getClassDescriptor(java.lang.Class aClass) throws StorageException
getClassDescriptor
in interface SchemaManager
aClass
- The class to which the descriptot should be returned.
StorageException
public ClassDescriptor createClassDescriptor(java.lang.Class aClass) throws StorageException
createClassDescriptor
in interface SchemaManager
aClass
- The class to which the descriptot should be created.
StorageException
public void transactionBegun(TransactionEvent event)
transactionBegun
in interface TransactionListener
public void transactionCommit(TransactionEvent event)
transactionCommit
in interface TransactionListener
public void transactionRollback(TransactionEvent event)
transactionRollback
in interface TransactionListener
public void transactionFinished(TransactionEvent event)
transactionFinished
in interface TransactionListener
public void lock(TID txid, OID oid, boolean exclusive, long timeout) throws TransactionTimeoutException
lock
in interface LockManager
oid
- 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 LockManager
oid
- The OID of the object to be released.
StorageException
public 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 |