uk.ac.soton.itinnovation.grid.service.sla.dao
Interface Locker

All Known Implementing Classes:
DatabaseLocker, JavaLocker

public interface Locker

We need "select for update" semantics in a number of places in the sla manager persistence code. However, GRIA supports different RDBMS backends, some of which (e.g. hypersonic) do not fully support transacations, or pessimistic locking.

Different Locker implementations are therefore used for using database locking or Java locking of entities.

Note that Locker implementations are treated as singletons and therefore should be thread safe.


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.
 

Method Detail

pessimisticLock

Object pessimisticLock(Class entityClass,
                       Serializable id)

unlock

void unlock(Class entityClass,
            Serializable id)
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.


unlockAll

void unlockAll()
This method unlocks all entities that were locked with pessimisticLock by the current thread. Only the locking thread can unlock.



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