Package org.hl7.fhir.utilities.npm
Class FilesystemPackageCacheManagerLocks.PackageLock
- java.lang.Object
-
- org.hl7.fhir.utilities.npm.FilesystemPackageCacheManagerLocks.PackageLock
-
- Enclosing class:
- FilesystemPackageCacheManagerLocks
public class FilesystemPackageCacheManagerLocks.PackageLock extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPackageLock(File lockFile, ReadWriteLock lock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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 Detail
-
PackageLock
protected PackageLock(File lockFile, ReadWriteLock lock)
-
-
Method Detail
-
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.
-
-