public interface Lockable
The
Lockable
interface defines methods to set the status of an object
to be locked or unlocked and to determine the status. Depending instances may
use Lockable
instances to determine whether to modify an implementing
instance or keep it untouched. An implementing instance may throw the
org.refcodes.exception.LockedRuntimeException
or the
org.refcodes.exception.LockedException
, depending whether it
wants that exception to be checked or not.-
Method Summary
-
Method Details
-
lock
void lock()Locks the implementing instance. -
unlock
void unlock()Unlocks the implementing instance. -
isLocked
boolean isLocked()Determines whether the implementing instance is locked.- Returns:
- True in case the implementing instance id is locked, else false-
-