Package google.registry.request.lock
Class LockHandlerImpl
java.lang.Object
google.registry.request.lock.LockHandlerImpl
- All Implemented Interfaces:
LockHandler
,Serializable
Implementation of
LockHandler
that uses the database lock.- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
LockHandlerImpl
-
-
Method Details
-
executeWithLocks
public boolean executeWithLocks(Callable<Void> callable, @Nullable String tld, org.joda.time.Duration leaseLength, String... lockNames) Acquire one or more locks and execute a VoidCallable
.Thread 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).
- Specified by:
executeWithLocks
in interfaceLockHandler
- Returns:
- whether all locks were acquired and the callable was run.
-