Interface WebResourceLockSet

All Known Implementing Classes:
DirResourceSet

public interface WebResourceLockSet
Interface implemented by WebResourceSet implementations that wish to provide locking functionality.
  • Method Details

    • getLock

      ReadWriteLock getLock(String path)
      Obtain a reentrant read/write lock for the resource at the provided path. The resource is not required to exist. Multiple calls to this method with the same path will return the same lock provided that at least one instance of the lock remains in use between the calls.
      Parameters:
      path - The path for which the lock should be obtained
      Returns:
      A reentrant read/write lock for the given resource.
    • lockForRead

      Deprecated.
      Unused. Will be removed in Tomcat 12 onwards. Use #getLock(String) instead.
      Lock the resource at the provided path for reading. The resource is not required to exist. Read locks are not exclusive.
      Parameters:
      path - The path to the resource to be locked for reading
      Returns:
      The WebResourceLockSet.ResourceLock that must be passed to unlockForRead(ResourceLock) to release the lock
    • unlockForRead

      @Deprecated void unlockForRead(WebResourceLockSet.ResourceLock resourceLock)
      Deprecated.
      Unused. Will be removed in Tomcat 12 onwards. Use #getLock(String) instead.
      Release a read lock from the resource associated with the given WebResourceLockSet.ResourceLock.
      Parameters:
      resourceLock - The WebResourceLockSet.ResourceLock associated with the resource for which a read lock should be released
    • lockForWrite

      Deprecated.
      Unused. Will be removed in Tomcat 12 onwards. Use #getLock(String) instead.
      Lock the resource at the provided path for writing. The resource is not required to exist. Write locks are exclusive.
      Parameters:
      path - The path to the resource to be locked for writing
      Returns:
      The WebResourceLockSet.ResourceLock that must be passed to unlockForWrite(ResourceLock) to release the lock
    • unlockForWrite

      @Deprecated void unlockForWrite(WebResourceLockSet.ResourceLock resourceLock)
      Deprecated.
      Unused. Will be removed in Tomcat 12 onwards. Use #getLock(String) instead.
      Release the write lock from the resource associated with the given WebResourceLockSet.ResourceLock.
      Parameters:
      resourceLock - The WebResourceLockSet.ResourceLock associated with the resource for which the write lock should be released