Package org.apache.catalina
Interface WebResourceLockSet
-
- All Known Implementing Classes:
DirResourceSet
public interface WebResourceLockSet
Interface implemented byWebResourceSet
implementations that wish to provide locking functionality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
WebResourceLockSet.ResourceLock
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebResourceLockSet.ResourceLock
lockForRead(java.lang.String path)
Lock the resource at the provided path for reading.WebResourceLockSet.ResourceLock
lockForWrite(java.lang.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 givenWebResourceLockSet.ResourceLock
.void
unlockForWrite(WebResourceLockSet.ResourceLock resourceLock)
Release the write lock from the resource associated with the givenWebResourceLockSet.ResourceLock
.
-
-
-
Method Detail
-
lockForRead
WebResourceLockSet.ResourceLock lockForRead(java.lang.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 tounlockForRead(ResourceLock)
to release the lock
-
unlockForRead
void unlockForRead(WebResourceLockSet.ResourceLock resourceLock)
Release a read lock from the resource associated with the givenWebResourceLockSet.ResourceLock
.- Parameters:
resourceLock
- TheWebResourceLockSet.ResourceLock
associated with the resource for which a read lock should be released
-
lockForWrite
WebResourceLockSet.ResourceLock lockForWrite(java.lang.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 tounlockForWrite(ResourceLock)
to release the lock
-
unlockForWrite
void unlockForWrite(WebResourceLockSet.ResourceLock resourceLock)
Release the write lock from the resource associated with the givenWebResourceLockSet.ResourceLock
.- Parameters:
resourceLock
- TheWebResourceLockSet.ResourceLock
associated with the resource for which the write lock should be released
-
-