public interface ManagedLock
ManagedLock allows callables, runnables and suppliers to be
run under a lock that is resolved against an input object.| Modifier and Type | Interface and Description |
|---|---|
static interface |
ManagedLock.ReadWrite
Maintains two managed locks that internally use the same
read/write locks |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
withLock(Callable<R> callable)
Execute the supplied
Callable under a lock
determined by the descriptor. |
void |
withLock(Runnable runnable)
Execute the supplied
Runnable under a lock determined by
the descriptor. |
<R> R |
withLock(Supplier<R> supplier)
Execute the supplied
Supplier under a lock
determined by the descriptor. |
<R> R withLock(@NotNull
Callable<R> callable)
throws Exception
Callable under a lock
determined by the descriptor.<R> R withLock(@NotNull
Supplier<R> supplier)
Supplier under a lock
determined by the descriptor.
Unlike withLock(Callable) this version returns a result and does
not declare a checked exception.
R - the result typesupplier - the operation to perform under lockCallable returnsCopyright © 2016 Atlassian. All rights reserved.