|
|||||||||||
| 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.JSOStorageManager
Manager responsible for storage operations with storable objects.
Storable,
Serialized Form| Field Summary |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
JSOStorageManager(java.util.Properties properties)
Constructs the manager. |
|
| Method Summary | |
void |
addStatusListener(StatusListener listener)
Starts sending status events to a listener. |
void |
addStorageListener(StorageListener listener)
Starts sending storage events to a listener. |
void |
batchStore(java.util.Collection objs,
boolean deep)
Stores a collection of objects in one only "batch" operation. |
void |
classAltered(SchemaEvent event)
Called when a class in the schema is altered. |
void |
classDropped(SchemaEvent event)
Called when a class in the schema is dropped. |
int |
count(Parameters params)
Counts the number of objects according to parameters. |
int |
countPages(Parameters params)
Counts the number of result pages according to parameters. |
OID |
createOID(java.lang.Object obj)
Creates an OID from an object. |
void |
delete(java.lang.Object obj)
Deletes an object. |
void |
delete(OID oid)
Deletes an object. |
int |
delete(Parameters params)
Deletes objects according to parameters. |
protected void |
finalize()
Stops the manager. |
int |
getCacheLoad()
Returns the number of cache slots in use. |
int |
getCacheSize()
Returns cache's size. |
ManagerInfo |
getManagerInfo()
Gets storage management information. |
OID |
getOID(java.lang.Object obj)
Returns OID of a transient storable object. |
int |
getPoolCapacity()
Returns the connection pool capacity. |
int |
getPoolLoad()
Returns the number of pool's connections in use. |
Status |
getStatus()
Gets manager's status. |
int |
getThreadCount()
Returns the number of active threads. |
Transaction |
getTransaction()
Gets the transaction associated to the current thread. |
int |
getTransactionCount()
Returns the number of active transactions. |
void |
invalidateCache()
Invalidates manager's cache. |
boolean |
isRemote()
Indicates if manager is running on another JVM. |
void |
objectDeleted(StorageEvent event)
Called when an object is deleted. |
void |
objectStored(StorageEvent event)
Called when an object is stored. |
void |
removeStatusListener(StatusListener listener)
Stops sending status events to a listener. |
void |
removeStorageListener(StorageListener listener)
Stops sending storage events to a listener. |
java.lang.Object |
retrieve(OID oid)
Retrieves an object. |
java.lang.Object |
retrieve(OID oid,
boolean summary)
Retrieves an object. |
java.lang.Object |
retrieve(OID oid,
boolean summary,
boolean lazy)
Retrieves an object. |
java.util.List |
retrieve(Parameters params)
Retrieves objects according to parameters. |
static void |
safellyStop(StorageManager aManager)
Stops a storage manager without throwing any exceptions. |
void |
start(StorageController aController)
Starts the manager. |
void |
statusChanged(StatusEvent event)
Called when a status change occur. |
void |
stop()
Stops the manager. |
OID |
store(java.lang.Object obj)
Stores an object and referenced objects. |
OID |
store(java.lang.Object obj,
boolean deep)
Stores an object. |
void |
subclassCreated(SchemaEvent event)
Called when a class in the schema is created and is subclass of another class. |
void |
subclassDropped(SchemaEvent event)
Called when a class in the schema is dropped and is subclass of another class. |
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 |
unlinkTransientObjects()
Unlinks transient storable objects from stored ones. |
| 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 JSOStorageManager(java.util.Properties properties)
throws java.rmi.RemoteException
properties - Properties containing parameters to the manager. The
following properties can be used:
jso.manager.pool.size: The maximum number of connections
of the pool. If not specified unlimited connections are allowed.jso.manager.cache.size: The number of objects to be kept
in cache.jso.manager.stop.retry: The interval, in milliseconds,
between two consecutive attempts of stopping manager while waiting
for threads and transactions to finish. A default value of 500ms is
used.jso.manager.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
5000ms is used..| Method Detail |
public void start(StorageController aController)
throws StorageException
start in interface StorageManageraController - Application's controller.
StorageException
public void stop()
throws StorageException
stop in interface StorageManagerStorageExceptionpublic static void safellyStop(StorageManager aManager)
aManager - Storage manager to be stopped.
public OID store(java.lang.Object obj)
throws StorageException
store in interface StorageManagerobj - The object to be stored.
StorageException - If any storage operation fails.
public OID store(java.lang.Object obj,
boolean deep)
throws StorageException
store in interface StorageManagerobj - The object to be stored.deep - Indicates if referenced objects should also be stored.
StorageException - If any storage operation fails.
public void batchStore(java.util.Collection objs,
boolean deep)
throws StorageException
batchStore in interface StorageManagerobjs - The collection of object to be stored.deep - Indicates if referenced objects should also be stored.
StorageException - If any storage operation fails.
public java.lang.Object retrieve(OID oid)
throws StorageException
retrieve in interface StorageManageroid - The identification of object to be stored.
StorageException - If any storage operation fails.
public java.lang.Object retrieve(OID oid,
boolean summary)
throws StorageException
retrieve in interface StorageManageroid - The identification of object to be stored.summary - Indicates if only summary fields should be retrieved.
StorageException - If any storage operation fails.
public java.lang.Object retrieve(OID oid,
boolean summary,
boolean lazy)
throws StorageException
retrieve in interface StorageManageroid - The identification of object to be stored.summary - Indicates if only summary fields should be retrieved.lazy - Indicates if referenced objects should be lazy loaded.
StorageException - If any storage operation fails.
public void delete(java.lang.Object obj)
throws StorageException
delete in interface StorageManagerobj - The object to be deleted.
StorageException - If any storage operation fails.
public void delete(OID oid)
throws StorageException
delete in interface StorageManageroid - The identification of object to be deleted.
StorageException - If any storage operation fails.
public int delete(Parameters params)
throws StorageException
delete in interface StorageManagerparams - Parameters to be used.
StorageException - If any storage operation fails.
public int count(Parameters params)
throws StorageException
count in interface QueryProcessorparams - Parameters to be used.
StorageException - If any storage operation fails.
public int countPages(Parameters params)
throws StorageException
countPages in interface QueryProcessorparams - Parameters to be used.
StorageException - If any storage operation fails.
public java.util.List retrieve(Parameters params)
throws StorageException
retrieve in interface QueryProcessorparams - Parameters to be used.
StorageException - If any storage operation fails.public OID createOID(java.lang.Object obj)
createOID in interface StorageManagerobj - An OID representation. Usually a String or
Number object.
public OID getOID(java.lang.Object obj)
throws StorageException
getOID in interface StorageManagerobj - The object to be identified.
StorageExceptionpublic void unlinkTransientObjects()
unlinkTransientObjects in interface StorageManagerpublic void statusChanged(StatusEvent event)
statusChanged in interface StatusListenerpublic Status getStatus()
getStatus in interface StorageManagerpublic boolean isRemote()
isRemote in interface StorageManagertrue if manager is running on another JVM;
false otherwise.public void addStatusListener(StatusListener listener)
addStatusListener in interface StorageManagerlistener - Listener to receive status events.public void removeStatusListener(StatusListener listener)
removeStatusListener in interface StorageManagerlistener - Listener to stop receiving status events.public void objectStored(StorageEvent event)
objectStored in interface StorageListenerpublic void objectDeleted(StorageEvent event)
objectDeleted in interface StorageListenerpublic void addStorageListener(StorageListener listener)
addStorageListener in interface StorageManagerlistener - Listener to receive storage events.public void removeStorageListener(StorageListener listener)
removeStorageListener in interface StorageManagerlistener - Listener to stop receiving storage events.public void classAltered(SchemaEvent event)
classAltered in interface SchemaListenerpublic void classDropped(SchemaEvent event)
classDropped in interface SchemaListenerpublic void subclassCreated(SchemaEvent event)
subclassCreated in interface SchemaListenerpublic void subclassDropped(SchemaEvent event)
subclassDropped in interface SchemaListener
public Transaction getTransaction()
throws StorageException
getTransaction in interface StorageManagerStorageExceptionpublic 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 TransactionListenerpublic void invalidateCache()
invalidateCache in interface StorageManagerpublic ManagerInfo getManagerInfo()
getManagerInfo in interface StorageManagerpublic int getThreadCount()
getThreadCount in interface ManagerInfopublic int getTransactionCount()
getTransactionCount in interface ManagerInfopublic int getCacheSize()
getCacheSize in interface ManagerInfopublic int getCacheLoad()
getCacheLoad in interface ManagerInfopublic int getPoolCapacity()
getPoolCapacity in interface ManagerInfopublic int getPoolLoad()
getPoolLoad in interface ManagerInfo
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 | ||||||||||