public interface FileLockService
Provides process-level file locking.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CloseableLocks the given file to protect read/write access from multiple processes on it.Locks the given file to protect read/write access from multiple processes on it.lockVirtually(File file) Locks the given file for this JVM to protect read/write access from multiple threads in this JVM on it.
-
Method Details
-
lock
Locks the given file to protect read/write access from multiple processes on it. Locking is advisory only, i.e. all processes must use the same locking mechanism.This is equivalent to
lock(File, long)with a timeout argument of 10 seconds. -
lock
Locks the given file to protect read/write access from multiple processes on it. Locking is advisory only, i.e. all processes must use the same locking mechanism. -
lockVirtually
Locks the given file for this JVM to protect read/write access from multiple threads in this JVM on it.
-