Package org.apache.catalina
Interface WebResourceLockSet
-
- All Known Implementing Classes:
DirResourceSet
public interface WebResourceLockSetInterface implemented byWebResourceSetimplementations that wish to provide locking functionality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classWebResourceLockSet.ResourceLock
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebResourceLockSet.ResourceLocklockForRead(java.lang.String path)Lock the resource at the provided path for reading.WebResourceLockSet.ResourceLocklockForWrite(java.lang.String path)Lock the resource at the provided path for writing.voidunlockForRead(WebResourceLockSet.ResourceLock resourceLock)Release a read lock from the resource associated with the givenWebResourceLockSet.ResourceLock.voidunlockForWrite(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.ResourceLockthat 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.ResourceLockassociated 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.ResourceLockthat 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.ResourceLockassociated with the resource for which the write lock should be released
-
-