Name
OverlappingFileLockException
Synopsis
This
exception is thrown by the
lock( )
and tryLock( )
methods
of FileChannel
if the requested lock region
overlaps a file lock that is already held by some thread in this JVM,
or if there is already a thread in this JVM waiting to lock an
overlapping region of the same file. The
FileChannel
file locking mechanism is designed to
lock files against concurrent access by two separate processes. Two
threads within the same JVM should not attempt to acquire a lock on
overlapping regions of the same file, and any attempt to do so causes
an exception of this type to be thrown.
Figure 13-34. java.nio.channels.OverlappingFileLockException
public class OverlappingFileLockException extends IllegalStateException { // Public Constructors public OverlappingFileLockException( ); }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.