com.atlassian.util.concurrent
Interface LockManager<T>

Type Parameters:
T - The input type that we lock on.

Deprecated. use a Function that returns a ManagedLock instead.

@Deprecated
public interface LockManager<T>

LockManager allows callables, suppliers and runnables to be run under a lock that is resolved against an input object.


Nested Class Summary
static interface LockManager.ReadWrite<T>
          Deprecated. Maintains two lock managers that internally use the same map of read/write locks
 
Method Summary
<R> R
withLock(T descriptor, java.util.concurrent.Callable<R> callable)
          Deprecated. Execute the supplied Callable under a lock determined by the descriptor.
 void withLock(T descriptor, java.lang.Runnable runnable)
          Deprecated. Execute the supplied Runnable under a lock determined by the descriptor.
<R> R
withLock(T descriptor, Supplier<R> supplier)
          Deprecated. Execute the supplied Supplier under a lock determined by the descriptor.
 

Method Detail

withLock

<R> R withLock(T descriptor,
               Supplier<R> supplier)
Deprecated. 
Execute the supplied Supplier under a lock determined by the descriptor. Does not throw a checked exception.

Type Parameters:
R - the result type
Parameters:
descriptor - to look up the lock
supplier - the operation to perform under lock
Returns:
whatever the supplied Supplier returns

withLock

<R> R withLock(T descriptor,
               java.util.concurrent.Callable<R> callable)
           throws java.lang.Exception
Deprecated. 
Execute the supplied Callable under a lock determined by the descriptor.

Type Parameters:
R - the result type
Parameters:
descriptor - to look up the lock
callable - the operation to perform under lock
Returns:
whatever the supplied Callable returns
Throws:
java.lang.Exception - if the supplied Callable throws an exception

withLock

void withLock(T descriptor,
              java.lang.Runnable runnable)
Deprecated. 
Execute the supplied Runnable under a lock determined by the descriptor.

Parameters:
descriptor - to look up the lock
runnable - the operation to perform under lock


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.