Package google.registry.request.lock
Interface LockHandler
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
LockHandlerImpl
Code execution locked on some shared resource.
Locks are either specific to a tld or global to the entire system, in which case a tld of null is used.
-
Method Summary
-
Method Details
-
executeWithLocks
boolean executeWithLocks(Callable<Void> callable, @Nullable String tld, org.joda.time.Duration leaseLength, String... lockNames) Acquire one or more locks and execute a VoidCallable
.Runs on a thread that will be killed if it doesn't complete before the lease expires.
Note that locks are specific either to a given tld or to the entire system (in which case tld should be passed as null).
- Returns:
- true if all locks were acquired and the callable was run; false otherwise.
-