Package 

Interface Lock


  • 
    public interface Lock
    
                        
    • Method Summary

      Modifier and Type Method Description
      abstract String acquire(List<String> keys, String storeId, Long expiration) Try to acquire the lock.
      abstract Boolean release(List<String> keys, String storeId, String token) Try to release the lock if token held by the lock has not changed.
      abstract Boolean refresh(List<String> keys, String storeId, String token, Long expiration) Try to refresh the lock expiration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • acquire

         abstract String acquire(List<String> keys, String storeId, Long expiration)

        Try to acquire the lock.

        Parameters:
        keys - keys to try to lock
        storeId - lock store id to save keys in (table, collection, ...
        expiration - how long to wait before releasing the key automatically, in millis
      • release

         abstract Boolean release(List<String> keys, String storeId, String token)

        Try to release the lock if token held by the lock has not changed.

        Parameters:
        keys - keys to try to unlock
        storeId - lock store id to release keys in (table, collection, ...
        token - token used to check if lock is still held by this lock
      • refresh

         abstract Boolean refresh(List<String> keys, String storeId, String token, Long expiration)

        Try to refresh the lock expiration.

        Parameters:
        keys - keys to try to refresh
        storeId - lock store id to refresh keys in (table, collection, ...
        token - token used to check if lock is still held by this lock
        expiration - how long to wait before releasing the key automatically, in millis