Package jetbrains.buildServer.util
Class MultipleLock<TKey,TObject,TLock>
- java.lang.Object
-
- jetbrains.buildServer.util.MultipleLock<TKey,TObject,TLock>
-
- Direct Known Subclasses:
ReadWriteMultipleLock
public abstract class MultipleLock<TKey,TObject,TLock> extends Object
- Author:
- Eugene Petrenko Created: 24.02.2010 18:37:50
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
MultipleLock.Locker<TLock>
-
Constructor Summary
Constructors Constructor Description MultipleLock()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract TKey
createKey(TObject object)
protected abstract TLock
createLock()
Called to create lock.protected void
locked(MultipleLock.Locker<TLock> locker, TObject object, ActionThrow<RuntimeException> action)
protected <R> R
locked(MultipleLock.Locker<TLock> locker, TObject object, FuncThrow<R,RuntimeException> action)
void
releaseLocks()
-
-
-
Method Detail
-
createLock
@NotNull protected abstract TLock createLock()
Called to create lock. Created lock may not be used.- Returns:
- new lock
-
locked
protected <R> R locked(@NotNull MultipleLock.Locker<TLock> locker, @NotNull TObject object, @NotNull FuncThrow<R,RuntimeException> action)
-
locked
protected void locked(@NotNull MultipleLock.Locker<TLock> locker, @NotNull TObject object, @NotNull ActionThrow<RuntimeException> action)
-
releaseLocks
public void releaseLocks()
-
-