Class ReLock

  • All Implemented Interfaces:
    Lock

    @Immutable
    @Loggable(1)
    public final class ReLock
    extends Object
    implements Lock
    Retriable lock.
    Since:
    0.5
    • 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.
        Specified by:
        name in interface Lock
        Returns:
        Name of this lock
      • 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 interface Lock
        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 interface Lock
        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 interface Lock
        Parameters:
        label - Label to attach
        Returns:
        TRUE if success, FALSE otherwise (label doesn't match)
        Throws:
        IOException - If any problem inside