Interface IRWLockManager<OBJECT,CONTEXT>
- 
- All Known Subinterfaces:
- IRWOLockManager<OBJECT,CONTEXT>
 - All Known Implementing Classes:
- RWLockManager,- RWOLockManager
 
 public interface IRWLockManager<OBJECT,CONTEXT>Support Multiple reads/no write and upgrade lock from read to write. Many context could requestwritelock at the same time. It will privileges first context that has already areadlock. If no one has any read lock, it's "first come first serve".- Since:
- 3.0
- Author:
- Eike Stepper
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classIRWLockManager.LockType
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanhasLock(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock)booleanhasLockByOthers(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock)voidlock(IRWLockManager.LockType type, CONTEXT context, java.util.Collection<? extends OBJECT> objectsToLock, long timeout)voidlock(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock, long timeout)voidunlock(CONTEXT context)Attempts to release all locks(read and write) for a given context.voidunlock(IRWLockManager.LockType type, CONTEXT context, java.util.Collection<? extends OBJECT> objectsToUnlock)Attempts to release for a given locktype, context and objects.
 
- 
- 
- 
Field Detail- 
WAITstatic final int WAIT - See Also:
- Constant Field Values
 
 - 
NO_WAITstatic final int NO_WAIT - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
lockvoid lock(IRWLockManager.LockType type, CONTEXT context, java.util.Collection<? extends OBJECT> objectsToLock, long timeout) throws java.lang.InterruptedException - Throws:
- java.lang.InterruptedException
 
 - 
lockvoid lock(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock, long timeout) throws java.lang.InterruptedException - Throws:
- java.lang.InterruptedException
 
 - 
unlockvoid unlock(IRWLockManager.LockType type, CONTEXT context, java.util.Collection<? extends OBJECT> objectsToUnlock) Attempts to release for a given locktype, context and objects.- Throws:
- java.lang.IllegalMonitorStateException- Unlocking objects without lock.
 
 - 
unlockvoid unlock(CONTEXT context) Attempts to release all locks(read and write) for a given context.
 - 
hasLockboolean hasLock(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock) 
 - 
hasLockByOthersboolean hasLockByOthers(IRWLockManager.LockType type, CONTEXT context, OBJECT objectToLock) 
 
- 
 
-