public class LockProvider extends Object
Provide the correct locking functionality based on how the LockProvider was created.
Instantiate a LockProvider with a function that will create a lock to lock on the provided key. The provided
function is a BiFunction. THe first argument to the function is the name of the lock the user asked for,
the second argument is the existing lock from the LockProvider map.
| Modifier and Type | Method and Description |
|---|---|
static void |
clear() |
static Lock |
getLock(String lockToObtain)
Uses the named lock function to retrieve the correct lock
|
static void |
instantiate(java.util.function.BiFunction<String,Lock,Lock> provider) |
static java.util.function.BiFunction<String,Lock,Lock> |
provider() |
public static void instantiate(java.util.function.BiFunction<String,Lock,Lock> provider)
public static Lock getLock(String lockToObtain)
lockToObtain - Name of the lock to obtain from the supplierpublic static java.util.function.BiFunction<String,Lock,Lock> provider()
public static void clear()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.