Package co.stateful.retry
Class ReLock
- java.lang.Object
-
- co.stateful.retry.ReLock
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringlabel()Read label (or empty text if lock doesn't exist).booleanlock(String label)Lock with label.Stringname()Its name.booleanunlock(String label)Unlock, if label matches.
-
-
-
Constructor Detail
-
ReLock
public ReLock(Lock orgn)
Ctor.- Parameters:
orgn- Original object
-
-
Method Detail
-
name
@RetryOnFailure(verbose=false, attempts=20, delay=20L, unit=SECONDS) public String name()Description copied from interface:LockIts name.
-
label
@RetryOnFailure(verbose=false, attempts=20, delay=20L, unit=SECONDS) public String label() throws IOExceptionDescription copied from interface:LockRead label (or empty text if lock doesn't exist).- Specified by:
labelin interfaceLock- Returns:
- Label of this lock (if the lock exists), or empty string
- Throws:
IOException- If any problem inside
-
lock
@RetryOnFailure(verbose=false, attempts=20, delay=20L, unit=SECONDS) public boolean lock(String label) throws IOExceptionDescription copied from interface:LockLock with label.- Specified by:
lockin interfaceLock- Parameters:
label- Label to attach- Returns:
- TRUE if success, FALSE otherwise
- Throws:
IOException- If any problem inside
-
unlock
@RetryOnFailure(verbose=false, attempts=20, delay=20L, unit=SECONDS) public boolean unlock(String label) throws IOExceptionDescription copied from interface:LockUnlock, if label matches.- Specified by:
unlockin interfaceLock- Parameters:
label- Label to attach- Returns:
- TRUE if success, FALSE otherwise (label doesn't match)
- Throws:
IOException- If any problem inside
-
-