|
|||||||||||
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 FormField 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 StorageManager
aController
- Application's controller.
StorageException
public void stop() throws StorageException
stop
in interface StorageManager
StorageException
public static void safellyStop(StorageManager aManager)
aManager
- Storage manager to be stopped.public OID store(java.lang.Object obj) throws StorageException
store
in interface StorageManager
obj
- 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 StorageManager
obj
- 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 StorageManager
objs
- 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 StorageManager
oid
- 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 StorageManager
oid
- 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 StorageManager
oid
- 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 StorageManager
obj
- The object to be deleted.
StorageException
- If any storage operation fails.public void delete(OID oid) throws StorageException
delete
in interface StorageManager
oid
- The identification of object to be deleted.
StorageException
- If any storage operation fails.public int delete(Parameters params) throws StorageException
delete
in interface StorageManager
params
- Parameters to be used.
StorageException
- If any storage operation fails.public int count(Parameters params) throws StorageException
count
in interface QueryProcessor
params
- Parameters to be used.
StorageException
- If any storage operation fails.public int countPages(Parameters params) throws StorageException
countPages
in interface QueryProcessor
params
- Parameters to be used.
StorageException
- If any storage operation fails.public java.util.List retrieve(Parameters params) throws StorageException
retrieve
in interface QueryProcessor
params
- Parameters to be used.
StorageException
- If any storage operation fails.public OID createOID(java.lang.Object obj)
createOID
in interface StorageManager
obj
- An OID representation. Usually a String
or
Number
object.public OID getOID(java.lang.Object obj) throws StorageException
getOID
in interface StorageManager
obj
- The object to be identified.
StorageException
public void unlinkTransientObjects()
unlinkTransientObjects
in interface StorageManager
public void statusChanged(StatusEvent event)
statusChanged
in interface StatusListener
public Status getStatus()
getStatus
in interface StorageManager
public boolean isRemote()
isRemote
in interface StorageManager
true
if manager is running on another JVM;
false
otherwise.public void addStatusListener(StatusListener listener)
addStatusListener
in interface StorageManager
listener
- Listener to receive status events.public void removeStatusListener(StatusListener listener)
removeStatusListener
in interface StorageManager
listener
- Listener to stop receiving status events.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 StorageManager
listener
- Listener to receive storage events.public void removeStorageListener(StorageListener listener)
removeStorageListener
in interface StorageManager
listener
- Listener to stop receiving storage events.public void classAltered(SchemaEvent event)
classAltered
in interface SchemaListener
public void classDropped(SchemaEvent event)
classDropped
in interface SchemaListener
public void subclassCreated(SchemaEvent event)
subclassCreated
in interface SchemaListener
public void subclassDropped(SchemaEvent event)
subclassDropped
in interface SchemaListener
public Transaction getTransaction() throws StorageException
getTransaction
in interface StorageManager
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 invalidateCache()
invalidateCache
in interface StorageManager
public ManagerInfo getManagerInfo()
getManagerInfo
in interface StorageManager
public int getThreadCount()
getThreadCount
in interface ManagerInfo
public int getTransactionCount()
getTransactionCount
in interface ManagerInfo
public int getCacheSize()
getCacheSize
in interface ManagerInfo
public int getCacheLoad()
getCacheLoad
in interface ManagerInfo
public int getPoolCapacity()
getPoolCapacity
in interface ManagerInfo
public 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 |