Package co.stateful
Interface Lock
-
- All Known Implementing Classes:
ReLock
@Immutable public interface Lock
Lock.- Since:
- 0.3
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
name
String name()
Its name.- Returns:
- Name of this lock
- Since:
- 0.8
-
label
String label() throws IOException
Read label (or empty text if lock doesn't exist).- Returns:
- Label of this lock (if the lock exists), or empty string
- Throws:
IOException
- If any problem inside- Since:
- 0.15
-
lock
boolean lock(String label) throws IOException
Lock with label.- Parameters:
label
- Label to attach- Returns:
- TRUE if success, FALSE otherwise
- Throws:
IOException
- If any problem inside- Since:
- 0.11
-
unlock
boolean unlock(String label) throws IOException
Unlock, if label matches.- Parameters:
label
- Label to attach- Returns:
- TRUE if success, FALSE otherwise (label doesn't match)
- Throws:
IOException
- If any problem inside- Since:
- 0.11
-
-