public interface ISMLocking
ISMLockingdefines an interface for a locking strategy of an
ItemStateManager. An implementation of
ISMLockingmust meet the following requirements:
Ian implementation must ensure that no write lock is issued for a change log that contains a reference to an item with id
Can implementation must ensure that no read lock is issued for an item that is contained in
C, unless the current thread is the owner of the write lock!
Can implementation must ensure that no write lock is issued for a change log
C'that intersects with
C. That is both change logs contain a reference to the same item. Please note that an implementation is free to block requests entirely for additional write lock while a write lock is active. It is not a requirement to support concurrent write locks.
C, the holder of the write lock (and any related threads) needs to be able to acquire a read lock even if other writers are waiting for the lock. This behaviour must continue also when the write lock has been downgraded. Note that it is not necessary for a holder of a read lock to be able to upgrade to a write lock.
|Modifier and Type||Interface and Description|
ISMLocking.ReadLock acquireReadLock(ItemId id) throws InterruptedException
id- an item id.
ISMLocking.WriteLock acquireWriteLock(ChangeLog changeLog) throws InterruptedException
changeLog- the change log
InterruptedException- if the thread is interrupted while creating the write lock.
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.