Class JimfsFileChannel.FakeFileLock

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Enclosing class:
    JimfsFileChannel

    static final class JimfsFileChannel.FakeFileLock
    extends java.nio.channels.FileLock
    A file lock that does nothing, since only one JVM process has access to this file system.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.atomic.AtomicBoolean valid  
    • Constructor Summary

      Constructors 
      Constructor Description
      FakeFileLock​(java.nio.channels.AsynchronousFileChannel channel, long position, long size, boolean shared)  
      FakeFileLock​(java.nio.channels.FileChannel channel, long position, long size, boolean shared)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isValid()  
      void release()  
      • Methods inherited from class java.nio.channels.FileLock

        acquiredBy, channel, close, isShared, overlaps, position, size, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • valid

        private final java.util.concurrent.atomic.AtomicBoolean valid
    • Constructor Detail

      • FakeFileLock

        public FakeFileLock​(java.nio.channels.FileChannel channel,
                            long position,
                            long size,
                            boolean shared)
      • FakeFileLock

        public FakeFileLock​(java.nio.channels.AsynchronousFileChannel channel,
                            long position,
                            long size,
                            boolean shared)
    • Method Detail

      • isValid

        public boolean isValid()
        Specified by:
        isValid in class java.nio.channels.FileLock
      • release

        public void release()
                     throws java.io.IOException
        Specified by:
        release in class java.nio.channels.FileLock
        Throws:
        java.io.IOException