Package com.atlassian.crowd.lock
Class ClusterLockWrapper
java.lang.Object
com.atlassian.crowd.lock.ClusterLockWrapper
Helper class supporting lambdas for
ClusterLock-
Constructor Summary
ConstructorsConstructorDescriptionClusterLockWrapper(Supplier<com.atlassian.beehive.ClusterLock> lockSupplier) -
Method Summary
-
Constructor Details
-
ClusterLockWrapper
- Parameters:
lockSupplier- supplier of the lock, under which all operations will be performed
-
-
Method Details
-
run
Runs providedRunnableunder the lock. Blocks to get the lock.- Parameters:
runnable-Runnableto be run under the lock
-
run
Runs providedSupplierunder the lock. Blocks to get the lock.- Parameters:
supplier-Supplierto be run under the lock- Returns:
- value returned by the supplier
-
tryRun
Tries to get the lock and runs providedRunnableunder the lock. If the lock wasn't available immediately then does nothing and returns false.
-