Interface IRWOLockManager<OBJECT,CONTEXT>
- All Superinterfaces:
IRWLockManager<OBJECT,CONTEXT>
- All Known Implementing Classes:
RWOLockManager
A
read/write lock manager that supports write option
locks.- Since:
- 3.2
- Author:
- Caspar De Groot
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceNested classes/interfaces inherited from interface org.eclipse.net4j.util.concurrent.IRWLockManager
IRWLockManager.LockType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IRWLockManager.LockTypestatic final intstatic final Collection<?>static final longFields inherited from interface org.eclipse.net4j.util.concurrent.IRWLockManager
NO_WAIT, WAIT -
Method Summary
Modifier and TypeMethodDescriptionlonglonglock(CONTEXT context, Collection<? extends OBJECT> objects, IRWLockManager.LockType lockType, int count, long timeout, IRWOLockManager.LockDeltaHandler<OBJECT, CONTEXT> deltaHandler, Consumer<RWOLockManager.LockState<OBJECT, CONTEXT>> stateHandler) Adds locks of the given lockType, owned by the given context to the given objects.voidlock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout) Deprecated.voidlock(IRWLockManager.LockType lockType, CONTEXT context, OBJECT objectToLock, long timeout) Deprecated.lock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout) Deprecated.voidDeprecated.longunlock(CONTEXT context, Collection<? extends OBJECT> objects, IRWLockManager.LockType lockType, int count, IRWOLockManager.LockDeltaHandler<OBJECT, CONTEXT> deltaHandler, Consumer<RWOLockManager.LockState<OBJECT, CONTEXT>> stateHandler) Removes locks of the given lockType, owned by the given context from the given objects.voidunlock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock) Deprecated.Deprecated.unlock2(CONTEXT context, Collection<? extends OBJECT> objectsToUnlock) Deprecated.unlock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock) Deprecated.Methods inherited from interface org.eclipse.net4j.util.concurrent.IRWLockManager
hasLock, hasLockByOthers
-
Field Details
-
ALL_OBJECTS
- Since:
- 3.16
-
ALL_LOCK_TYPES
- Since:
- 3.16
-
ALL_LOCKS
static final int ALL_LOCKS- Since:
- 3.16
- See Also:
-
NO_TIMEOUT
static final long NO_TIMEOUT- Since:
- 3.16
- See Also:
-
-
Method Details
-
getModCount
long getModCount()- Since:
- 3.16
-
lock
long lock(CONTEXT context, Collection<? extends OBJECT> objects, IRWLockManager.LockType lockType, int count, long timeout, IRWOLockManager.LockDeltaHandler<OBJECT, CONTEXT> deltaHandler, Consumer<RWOLockManager.LockState<OBJECT, throws InterruptedException, TimeoutRuntimeExceptionCONTEXT>> stateHandler) Adds locks of the given lockType, owned by the given context to the given objects.- Parameters:
context- The lock context to add from theobjects. Must not benull.objects- The objects to lock. Must not benull.lockType- The type of lock to add to theobjects. Must not benull.count- The number of locks to add to each of theobjects.timeout- The period in milliseconds after that aTimeoutRuntimeExceptionis thrown if some or all of theobjectscould not be locked, orNO_TIMEOUTto attempt forever to acquire the requested locks.deltaHandler- A handler that is notified with each delta in alock state, ornullif no such notification is needed. The handler is notified at most once per delta, but it can happen that the handler is notified before the lock operation finally fails with one of the specified exceptions. The notification handling should be fast because notifications occur while the calling thread is synchronized on this lock manager.stateHandler- A handler that is notified with each newlock state, ornullif no such notification is needed.. The handler is notified at most once per lock state, but it can happen that the handler is notified before the lock operation finally fails with one of the specified exceptions. The notification handling should be fast because notifications occur while the calling thread is synchronized on this lock manager.- Returns:
- The new
modification count. - Throws:
InterruptedException- If the calling thread is interrupted.TimeoutRuntimeException- If the timeout period has expired and some or all of theobjectscould not be locked.- Since:
- 3.16
-
unlock
long unlock(CONTEXT context, Collection<? extends OBJECT> objects, IRWLockManager.LockType lockType, int count, IRWOLockManager.LockDeltaHandler<OBJECT, CONTEXT> deltaHandler, Consumer<RWOLockManager.LockState<OBJECT, CONTEXT>> stateHandler) Removes locks of the given lockType, owned by the given context from the given objects.- Parameters:
context- The lock context to remove from theobjects. Must not benull.objects- The objects to unlock, orALL_OBJECTSto unlock all objects of thecontext.lockType- The type of lock to remove from theobjects, orALL_LOCK_TYPESto remove the locks of all types.count- The number of locks to remove from each of theobjects, orALL_LOCKSto remove all locks.deltaHandler- A handler that is notified with each delta in aRWOLockManager.LockState, ornullif no such notification is needed.stateHandler- A handler that is notified with each newRWOLockManager.LockState, ornullif no such notification is needed.- Since:
- 3.16
-
lock2
@Deprecated List<RWOLockManager.LockState<OBJECT,CONTEXT>> lock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout) throws InterruptedException Deprecated.- Throws:
InterruptedException
-
unlock2
@Deprecated List<RWOLockManager.LockState<OBJECT,CONTEXT>> unlock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock) Deprecated. -
unlock2
@Deprecated List<RWOLockManager.LockState<OBJECT,CONTEXT>> unlock2(CONTEXT context, Collection<? extends OBJECT> objectsToUnlock) Deprecated. -
unlock2
Deprecated. -
lock
@Deprecated void lock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout) throws InterruptedException Deprecated.- Specified by:
lockin interfaceIRWLockManager<OBJECT,CONTEXT> - Throws:
InterruptedException
-
lock
@Deprecated void lock(IRWLockManager.LockType lockType, CONTEXT context, OBJECT objectToLock, long timeout) throws InterruptedException Deprecated.- Specified by:
lockin interfaceIRWLockManager<OBJECT,CONTEXT> - Throws:
InterruptedException
-
unlock
@Deprecated void unlock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock) Deprecated.Description copied from interface:IRWLockManagerAttempts to release for a given lock type, context and objects.- Specified by:
unlockin interfaceIRWLockManager<OBJECT,CONTEXT>
-
unlock
Deprecated.Description copied from interface:IRWLockManagerAttempts to release all locks(read and write) for a given context.- Specified by:
unlockin interfaceIRWLockManager<OBJECT,CONTEXT>
-