Class LockUtil


  • public class LockUtil
    extends java.lang.Object
    Class HttpServerRequestUtil.
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.vertx.core.Future<java.lang.Boolean> acquireLock​(Lock lockImpl, java.lang.String lock, java.lang.String token, long lockExpiryMs, org.slf4j.Logger log)
      Acquire a lock.
      static void releaseLock​(Lock lockImpl, java.lang.String lock, java.lang.String token, org.slf4j.Logger log)
      Release a lock.
      • Methods inherited from class java.lang.Object

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

      • acquireLock

        public static io.vertx.core.Future<java.lang.Boolean> acquireLock​(Lock lockImpl,
                                                                          java.lang.String lock,
                                                                          java.lang.String token,
                                                                          long lockExpiryMs,
                                                                          org.slf4j.Logger log)
        Acquire a lock. Resolves always to Boolean.TRUE when no lock implementation is provided
        Parameters:
        lockImpl - the lock implementation
        lock - the lock
        token - the unique token
        lockExpiryMs - the expiry of the lock
        log - the logger
        Returns:
        A boolean Future whether the lock could has been acquired or not
      • releaseLock

        public static void releaseLock​(Lock lockImpl,
                                       java.lang.String lock,
                                       java.lang.String token,
                                       org.slf4j.Logger log)
        Release a lock.
        Parameters:
        lockImpl - the lock implementation
        lock - the lock
        token - the unique token
        log - the Logger