WebResourceLockSet (Apache Tomcat 11.0.21 API Documentation)
Description: declaration: package: org.apache.catalina, interface: WebResourceLockSet

# Interface WebResourceLockSet

All Known Implementing Classes:
  `DirResourceSet`

public interface WebResourceLockSet
Interface implemented by `WebResourceSet` implementations that wish to provide locking functionality.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static class`
  `WebResourceLockSet.ResourceLock`
  Deprecated.
  Unused.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ReadWriteLock`
  `getLock(String path)`
  Obtain a reentrant read/write lock for the resource at the provided path.
  `WebResourceLockSet.ResourceLock`
  `lockForRead(String path)`
  Deprecated.
  Unused.
  `WebResourceLockSet.ResourceLock`
  `lockForWrite(String path)`
  Deprecated.
  Unused.
  `void`
  `unlockForRead(WebResourceLockSet.ResourceLock resourceLock)`
  Deprecated.
  Unused.
  `void`
  `unlockForWrite(WebResourceLockSet.ResourceLock resourceLock)`
  Deprecated.
  Unused.

- ## 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 WebResourceLockSet.ResourceLock lockForRead(String path)
    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 WebResourceLockSet.ResourceLock lockForWrite(String path)
    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