Interface LockStore<R,O>

Type Parameters:
R - The type of the resource subject to locking
O - The type of the owner of locks
All Known Implementing Classes:
LockStoreImpl

public interface LockStore<R,O>
Interface to manage a set of read/write locks for a set of resources
Author:
Claus Stadler
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Get the API to manage read/write locks for a given resource
    Get a stream of all existing resource locks The resulting stream should be weakly consistent (See invalid input: '{@link Files#list(java.nio.file.Path)). The result stream should always be used in a try-with-resources block in order to ensure release of resources.'
  • Method Details

    • getLockForResource

      ResourceLock<O> getLockForResource(String resource)
      Get the API to manage read/write locks for a given resource
      Parameters:
      resource -
      Returns:
    • getLockByKey

      ResourceLock<O> getLockByKey(Path<String> lockKey)
    • streamResourceLocks

      Stream<ResourceLock<O>> streamResourceLocks() throws IOException
      Get a stream of all existing resource locks The resulting stream should be weakly consistent (See invalid input: '{@link Files#list(java.nio.file.Path)). The result stream should always be used in a try-with-resources block in order to ensure release of resources.'
      Returns:
      Throws:
      IOException