Interface Locker

    • Method Detail

      • keepAlive

        boolean keepAlive()
                   throws IOException
        Used by a timer to keep alive the lock. If the method returns false the broker should be terminated if an exception is thrown, the lock state cannot be determined
        Throws:
        IOException
      • setLockAcquireSleepInterval

        void setLockAcquireSleepInterval​(long lockAcquireSleepInterval)
        set the delay interval in milliseconds between lock acquire attempts
        Parameters:
        lockAcquireSleepInterval - the sleep interval in miliseconds
      • setName

        void setName​(String name)
        Set the name of the lock to use.
      • setFailIfLocked

        void setFailIfLocked​(boolean failIfLocked)
        Specify whether to fail immediately if the lock is already held. When set, the CustomLock must throw an IOException immediately upon detecting the lock is already held.
        Parameters:
        failIfLocked - true => fail immediately if the lock is held; false => block until the lock can be obtained (default).
      • configure

        void configure​(PersistenceAdapter persistenceAdapter)
                throws IOException
        Optionally configure the locker with the persistence adapter currently used You can use persistence adapter configuration details like, data directory datasource, etc. to be used by the locker
        Parameters:
        persistenceAdapter -
        Throws:
        IOException