uk.ac.soton.itinnovation.grid.service.sla.dao
Class DatabaseLocker

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.sla.dao.DatabaseLocker
All Implemented Interfaces:
Locker

public class DatabaseLocker
extends Object
implements Locker


Constructor Summary
protected DatabaseLocker()
           
 
Method Summary
 Object pessimisticLock(Class entityClass, Serializable id)
           
 void unlock(Class entityClass, Serializable id)
          This method removes a lock.
 void unlockAll()
          This method unlocks all entities that were locked with pessimisticLock by the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseLocker

protected DatabaseLocker()
Method Detail

pessimisticLock

public Object pessimisticLock(Class entityClass,
                              Serializable id)
Specified by:
pessimisticLock in interface Locker

unlock

public void unlock(Class entityClass,
                   Serializable id)
Description copied from interface: Locker
This method removes a lock. Implemenatations should unlock only if the current thread is the owning thread. The owning thread is thread that originally obtained the lock.

Furthermore, implemenations should be tolerant of client errors and therefore must not throw runtime exceptions.

Specified by:
unlock in interface Locker

unlockAll

public void unlockAll()
Description copied from interface: Locker
This method unlocks all entities that were locked with pessimisticLock by the current thread. Only the locking thread can unlock.

Specified by:
unlockAll in interface Locker


Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.