WebResourceLockSet (Apache Tomcat 10.1.57 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`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `WebResourceLockSet.ResourceLock`
  `lockForRead(String path)`
  Lock the resource at the provided path for reading.
  `WebResourceLockSet.ResourceLock`
  `lockForWrite(String path)`
  Lock the resource at the provided path for writing.
  `void`
  `unlockForRead(WebResourceLockSet.ResourceLock resourceLock)`
  Release a read lock from the resource associated with the given `WebResourceLockSet.ResourceLock`.
  `void`
  `unlockForWrite(WebResourceLockSet.ResourceLock resourceLock)`
  Release the write lock from the resource associated with the given `WebResourceLockSet.ResourceLock`.

- ## Method Details

  - ### lockForRead

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

    void unlockForRead(WebResourceLockSet.ResourceLock resourceLock)
    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

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

    void unlockForWrite(WebResourceLockSet.ResourceLock resourceLock)
    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