Package org.eclipse.net4j.util.concurrent

# Schnittstelle IRWOLockManager<OBJECT,CONTEXT>

Alle Superschnittstellen:
  `IRWLockManager<OBJECT,CONTEXT>`

Alle bekannten Implementierungsklassen:
  `RWOLockManager`

public interface IRWOLockManager<OBJECT,CONTEXT> extends IRWLockManager<OBJECT,CONTEXT>
A `read/write lock manager` that supports `write option` locks.

Seit:
  3.2
Autor:
  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.

## Verschachtelte Klassen - Übersicht

Verschachtelte Klassen
Modifizierer und Typ
Schnittstelle
Beschreibung
`static interface`
`IRWOLockManager.LockDeltaHandler<OBJECT,CONTEXT>`

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.util.concurrent.IRWLockManager

`IRWLockManager.LockType`

## Feldübersicht

Felder
Modifizierer und Typ
Feld
Beschreibung
`static final IRWLockManager.LockType`
`ALL_LOCK_TYPES`
`static final int`
`ALL_LOCKS`
`static final Collection<?>`
`ALL_OBJECTS`
`static final long`
`NO_TIMEOUT`

### Von Schnittstelle geerbte Felder org.eclipse.net4j.util.concurrent.IRWLockManager

`NO_WAIT, WAIT`

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`long`
`getModCount()`
`long`
`lock(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.
`void`
`lock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout)`
Veraltet.
`void`
`lock(IRWLockManager.LockType lockType, CONTEXT context, OBJECT objectToLock, long timeout)`
Veraltet.
`List<RWOLockManager.LockState<OBJECT,CONTEXT>>`
`lock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout)`
Veraltet.
`void`
`unlock(CONTEXT context)`
Veraltet.
`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.
`void`
`unlock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)`
Veraltet.
`List<RWOLockManager.LockState<OBJECT,CONTEXT>>`
`unlock2(CONTEXT context)`
Veraltet.
`List<RWOLockManager.LockState<OBJECT,CONTEXT>>`
`unlock2(CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)`
Veraltet.
`List<RWOLockManager.LockState<OBJECT,CONTEXT>>`
`unlock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)`
Veraltet.

### Von Schnittstelle geerbte Methoden org.eclipse.net4j.util.concurrent.IRWLockManager

`hasLock, hasLockByOthers`

## Felddetails

### ALL_OBJECTS

static final Collection<?> ALL_OBJECTS

Seit:
  3.16

### ALL_LOCK_TYPES

static final IRWLockManager.LockType ALL_LOCK_TYPES

Seit:
  3.16

### ALL_LOCKS

static final int ALL_LOCKS

Seit:
  3.16
Siehe auch:
  - Konstantenfeldwerte

### NO_TIMEOUT

static final long NO_TIMEOUT

Seit:
  3.16
Siehe auch:
  - Konstantenfeldwerte

## Methodendetails

### getModCount

long getModCount()

Seit:
  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,CONTEXT>> stateHandler) throws InterruptedException, TimeoutRuntimeException
Adds locks of the given lockType, owned by the given context to the given objects.

Parameter:
  `context` - The lock context to add from the `objects`. Must not be `null`.
  `objects` - The objects to lock. Must not be `null`.
  `lockType` - The type of lock to add to the `objects`. Must not be `null`.
  `count` - The number of locks to add to each of the `objects`.
  `timeout` - The period in milliseconds after that a `TimeoutRuntimeException` is thrown if some or all of the `objects` could not be locked, or `NO_TIMEOUT` to attempt forever to acquire the requested locks.
  `deltaHandler` - A handler that is notified with each delta in a `lock state`, or `null` if 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 new `lock state`, or `null` if 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.
Gibt zurück:
  The new `modification count`.
Löst aus:
  `InterruptedException` - If the calling thread is interrupted.
  `TimeoutRuntimeException` - If the timeout period has expired and some or all of the `objects` could not be locked.
Seit:
  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.

Parameter:
  `context` - The lock context to remove from the `objects`. Must not be `null`.
  `objects` - The objects to unlock, or `ALL_OBJECTS` to unlock all objects of the `context`.
  `lockType` - The type of lock to remove from the `objects`, or `ALL_LOCK_TYPES` to remove the locks of all types.
  `count` - The number of locks to remove from each of the `objects`, or `ALL_LOCKS` to remove all locks.
  `deltaHandler` - A handler that is notified with each delta in a `RWOLockManager.LockState`, or `null` if no such notification is needed.
  `stateHandler` - A handler that is notified with each new `RWOLockManager.LockState`, or `null` if no such notification is needed.
Seit:
  3.16

### lock2

@Deprecated List<RWOLockManager.LockState<OBJECT,CONTEXT>> lock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout) throws InterruptedException
Veraltet.

Löst aus:
  `InterruptedException`

### unlock2

@Deprecated List<RWOLockManager.LockState<OBJECT,CONTEXT>> unlock2(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)
Veraltet.

### unlock2

@Deprecated List<RWOLockManager.LockState<OBJECT,CONTEXT>> unlock2(CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)
Veraltet.

### unlock2

@Deprecated List<RWOLockManager.LockState<OBJECT,CONTEXT>> unlock2(CONTEXT context)
Veraltet.

### lock

@Deprecated void lock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToLock, long timeout) throws InterruptedException
Veraltet.

Angegeben von:
  `lock` in Schnittstelle `IRWLockManager<OBJECT,CONTEXT>`
Löst aus:
  `InterruptedException`

### lock

@Deprecated void lock(IRWLockManager.LockType lockType, CONTEXT context, OBJECT objectToLock, long timeout) throws InterruptedException
Veraltet.

Angegeben von:
  `lock` in Schnittstelle `IRWLockManager<OBJECT,CONTEXT>`
Löst aus:
  `InterruptedException`

### unlock

@Deprecated void unlock(IRWLockManager.LockType lockType, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)
Veraltet.
Beschreibung aus Schnittstelle kopiert: `IRWLockManager`
Attempts to release for a given lock type, context and objects.

Angegeben von:
  `unlock` in Schnittstelle `IRWLockManager<OBJECT,CONTEXT>`

### unlock

@Deprecated void unlock(CONTEXT context)
Veraltet.
Beschreibung aus Schnittstelle kopiert: `IRWLockManager`
Attempts to release all locks(read and write) for a given context.

Angegeben von:
  `unlock` in Schnittstelle `IRWLockManager<OBJECT,CONTEXT>`