Interface LockSetService

All Known Implementing Classes:
WeakReferenceLockSetService

public interface LockSetService
Locks a set of objects based on their identity in a consistent and order ensuring no deadlocks when having to acquire multiple locks.
  • Method Details

    • logStatus

      void logStatus()
      Logs the status of the LockSetService.
    • getPathReadMonitor

      default Monitor getPathReadMonitor(Collection<Path> paths)
      Gets a Monitor which will lock all resources in the Path instances for read operations.
      Parameters:
      paths - a collection of Path instances
      Returns:
      an instance of Monitor which aggregates locks across all requested resources.
    • getPathWriteMonitor

      default Monitor getPathWriteMonitor(Collection<Path> paths)
      Gets a Monitor which will lock all resources in the Path instances for write operations.
      Parameters:
      paths - a collection of Path instances
      Returns:
      an instance of Monitor which aggregates locks across all requested resources.
    • getPathReadMonitor

      Monitor getPathReadMonitor(Path path)
      Gets a single Monitor for the supplied ResourceId (for reading). When requesting a Path with a Path.WILDCARD or Path.WILDCARD_RECURSIVE component, this will essentially acquire all monitors for matching paths.
      Parameters:
      path - the Path
      Returns:
      the Monitor locking those Path instances
    • getPathWriteMonitor

      Monitor getPathWriteMonitor(Path path)
      Gets a single Monitor for the supplied ResourceId (for writing). When requesting a Path with a Path.WILDCARD or Path.WILDCARD_RECURSIVE component, this will essentially acquire all monitors for matching paths.
      Parameters:
      path - the Path
      Returns:
      the Monitor locking those Path instances
    • getResourceIdReadMonitor

      default Monitor getResourceIdReadMonitor(SortedSet<ResourceId> resourceIds)
      Gets a Monitor which will lock all resources in the ResourceId instances for read operations.
      Parameters:
      resourceIds - a collection of ResourceId instances
      Returns:
      an instance of Monitor which aggregates locks across all requested resources.
    • getResourceIdWriteMonitor

      default Monitor getResourceIdWriteMonitor(SortedSet<ResourceId> resourceIds)
      Gets a Monitor which will lock all resources in the ResourceId instances for write operations.
      Parameters:
      resourceIds - a collection of ResourceId instances
      Returns:
      an instance of Monitor which aggregates locks across all requested resources.
    • getResourceIdReadMonitor

      Monitor getResourceIdReadMonitor(ResourceId resourceId)
      Gets a single Monitor for the supplied ResourceId (for reading).
      Parameters:
      resourceId - the ResourceId
      Returns:
      the Monitor locking those ResourceId instances
    • getResourceIdWriteMonitor

      Monitor getResourceIdWriteMonitor(ResourceId resourceId)
      Gets a single Monitor for the supplied ResourceId (for writing).
      Parameters:
      resourceId - the ResourceId
      Returns:
      the Monitor locking those ResourceId instances