Package org.hl7.fhir.utilities.npm
Class FilesystemPackageCacheManagerLocks.PackageLock
java.lang.Object
org.hl7.fhir.utilities.npm.FilesystemPackageCacheManagerLocks.PackageLock
- Enclosing class:
- FilesystemPackageCacheManagerLocks
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TdoReadWithLock(FilesystemPackageCacheManager.CacheLockFunction<T> function, FilesystemPackageCacheManagerLocks.LockParameters lockParameters) Wraps the execution of a package read function with the appropriate cache, package, and .lock file locking and checks.<T> TdoWriteWithLock(FilesystemPackageCacheManager.CacheLockFunction<T> function, FilesystemPackageCacheManagerLocks.LockParameters lockParameters) Wraps the execution of a package write function with the appropriate cache, package, and .lock file locking and checks.
-
Constructor Details
-
PackageLock
-
-
Method Details
-
doReadWithLock
public <T> T doReadWithLock(FilesystemPackageCacheManager.CacheLockFunction<T> function, @Nullable FilesystemPackageCacheManagerLocks.LockParameters lockParameters) throws IOException Wraps the execution of a package read function with the appropriate cache, package, and .lock file locking and checks.- Type Parameters:
T- The return type of the function- Parameters:
function- The function to executelockParameters- The parameters for the lock- Returns:
- The return of the function
- Throws:
IOException- If an error occurs while managing locking.
-
doWriteWithLock
public <T> T doWriteWithLock(FilesystemPackageCacheManager.CacheLockFunction<T> function, @Nullable FilesystemPackageCacheManagerLocks.LockParameters lockParameters) throws IOException Wraps the execution of a package write function with the appropriate cache, package, and .lock file locking and checks.- Type Parameters:
T- The return type of the function- Parameters:
function- The function to executelockParameters- The parameters for the lock- Returns:
- The return of the function
- Throws:
IOException- If an error occurs while managing locking.
-