net.sf.jso.transaction
Interface LockManager

All Known Subinterfaces:
StorageController
All Known Implementing Classes:
JSOLockManager, JSOStorageController, StorageControllerProxy

public interface LockManager

Manager responsible for locking (concurrency) control.


Method Summary
 LockInfo getLockInfo()
          Gets transaction processing information.
 void lock(TID txid, OID oid, boolean exclusive, long timeout)
          Holds a lock for an object.
 void release(TID txid, OID oid)
          Releases the lock for an object
 

Method Detail

lock

public void lock(TID txid,
                 OID oid,
                 boolean exclusive,
                 long timeout)
          throws TransactionTimeoutException
Holds a lock for an object. All locks are released when transaction finishes.

Parameters:
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.
Throws:
TransactionTimeoutException

release

public void release(TID txid,
                    OID oid)
             throws StorageException
Releases the lock for an object

Parameters:
oid - The OID of the object to be released.
Throws:
StorageException

getLockInfo

public LockInfo getLockInfo()
Gets transaction processing information.

Returns:
Information about transaction processing.