concurrency
Class LockingTable

java.lang.Object
  extended byconcurrency.LockingTable

public final class LockingTable
extends java.lang.Object

The locking table decides when to grant locks and when not.


Constructor Summary
LockingTable()
           
 
Method Summary
 void addTransaction(Transaction trans)
          Adds a new transaction to the locking table.
 boolean lock(Transaction trans, LockableObject obj, LockMode lockmode)
          Checks is a lock can be granted and the lock is registred in the table.
 void removeTransaction(Transaction trans)
          Removes a transaction from the locking table.
 void show()
          Shows to de locking table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockingTable

public LockingTable()
Method Detail

addTransaction

public void addTransaction(Transaction trans)
Adds a new transaction to the locking table.

Parameters:
trans - The transaction to add.

lock

public boolean lock(Transaction trans,
                    LockableObject obj,
                    LockMode lockmode)
             throws NotActiveTransactionException
Checks is a lock can be granted and the lock is registred in the table.

Parameters:
trans - The transaction that locks.
obj - The object to lock.
lockmode - The locking mode.
Throws:
NotActiveTransactionException

removeTransaction

public void removeTransaction(Transaction trans)
Removes a transaction from the locking table.

Parameters:
trans - The transaction to remove.

show

public void show()
Shows to de locking table.