Class LockHandlerImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean executeWithLocks​(java.util.concurrent.Callable<java.lang.Void> callable, java.lang.String tld, org.joda.time.Duration leaseLength, java.lang.String... lockNames)
      Acquire one or more locks and execute a Void Callable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • executeWithLocks

        public boolean executeWithLocks​(java.util.concurrent.Callable<java.lang.Void> callable,
                                        @Nullable
                                        java.lang.String tld,
                                        org.joda.time.Duration leaseLength,
                                        java.lang.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.