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 String
label()
Read label (or empty text if lock doesn't exist).boolean
lock(String label)
Lock with label.String
name()
Its name.boolean
unlock(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:Lock
Its name.
-
label
@RetryOnFailure(verbose=false, attempts=20, delay=20L, unit=SECONDS) public String label() throws IOException
Description copied from interface:Lock
Read label (or empty text if lock doesn't exist).- Specified by:
label
in 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 IOException
Description copied from interface:Lock
Lock with label.- Specified by:
lock
in 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 IOException
Description copied from interface:Lock
Unlock, if label matches.- Specified by:
unlock
in interfaceLock
- Parameters:
label
- Label to attach- Returns:
- TRUE if success, FALSE otherwise (label doesn't match)
- Throws:
IOException
- If any problem inside
-
-