lockmgr
Class CopyOfLockManager

java.lang.Object
  extended by lockmgr.CopyOfLockManager
All Implemented Interfaces:
ILockManager

public class CopyOfLockManager
extends java.lang.Object
implements ILockManager


Constructor Summary
CopyOfLockManager()
           
 
Method Summary
 boolean lock(int xid, java.lang.String strData, LockType lockType)
          Locks a data object in read or write mode blocking the caller if lock cannot be acquired.
 boolean unlockAll(int xid)
          Releases all locks held by the specified transaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyOfLockManager

public CopyOfLockManager()
Method Detail

lock

public boolean lock(int xid,
                    java.lang.String strData,
                    LockType lockType)
             throws DeadlockException
Description copied from interface: ILockManager
Locks a data object in read or write mode blocking the caller if lock cannot be acquired.

Specified by:
lock in interface ILockManager
Parameters:
xid - The id of the transaction on which behalf the data object should be locked
strData - The unique name of the data object
lockType - The type of lock which is to be acquired (read or write lock)
Returns:
true
Throws:
DeadlockException - thrown if a cycle will occur in the waiting graph due to this operation

unlockAll

public boolean unlockAll(int xid)
Description copied from interface: ILockManager
Releases all locks held by the specified transaction.

Specified by:
unlockAll in interface ILockManager
Parameters:
xid - The id of the transaction
Returns:
true