Package org.swisspush.gateleen.core.util
Class LockUtil
- java.lang.Object
-
- org.swisspush.gateleen.core.util.LockUtil
-
public class LockUtil extends java.lang.ObjectClass 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 voidreleaseLock(Lock lockImpl, java.lang.String lock, java.lang.String token, org.slf4j.Logger log)Release a lock.
-
-
-
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 toBoolean.TRUEwhen no lock implementation is provided- Parameters:
lockImpl- the lock implementationlock- the locktoken- the unique tokenlockExpiryMs- the expiry of the locklog- the logger- Returns:
- A boolean
Futurewhether 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 implementationlock- the locktoken- the unique tokenlog- the Logger
-
-