net.sf.jso.transaction
Class JSOLockManager

java.lang.Object
  extended bynet.sf.jso.transaction.JSOLockManager
All Implemented Interfaces:
LockManager

public class JSOLockManager
extends java.lang.Object
implements LockManager


Constructor Summary
JSOLockManager()
           
 
Method Summary
 LockInfo getLockInfo()
          Gets transaction processing information.
 void lock(TID txid, OID oid, boolean exclusive, long timeout)
          Tries to hold a lock for an object.
 void release(TID txid, OID oid)
          Releases the lock for an object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSOLockManager

public JSOLockManager()
Method Detail

lock

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

Specified by:
lock in interface LockManager
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

Specified by:
release in interface LockManager
Parameters:
oid - The OID of the object to be released.
Throws:
StorageException

getLockInfo

public LockInfo getLockInfo()
Gets transaction processing information.

Specified by:
getLockInfo in interface LockManager
Returns:
Information about transaction processing.