Class LockHandlerImpl

java.lang.Object
google.registry.request.lock.LockHandlerImpl
All Implemented Interfaces:
LockHandler, Serializable

public class LockHandlerImpl extends Object implements LockHandler
Implementation of LockHandler that uses the database lock.
See Also:
  • Constructor Details

    • LockHandlerImpl

      @Inject public LockHandlerImpl(Clock clock)
  • 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 Void Callable.

      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 interface LockHandler
      Returns:
      whether all locks were acquired and the callable was run.