com.faunos.util.io
Class LockProtectedFileChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.FileChannel
com.faunos.util.io.FilterFileChannel
com.faunos.util.io.LockProtectedFileChannel
- All Implemented Interfaces:
- Closeable, ByteChannel, Channel, GatheringByteChannel, InterruptibleChannel, ReadableByteChannel, ScatteringByteChannel, WritableByteChannel
public class LockProtectedFileChannel
- extends FilterFileChannel
A FilterFileChannel
that prevents locking any
part of the underlying file channel. Invoking any of the
methods overridden in this class raises an
UnsupportedOperationException
.
- Author:
- Babak Farhang
Methods inherited from class com.faunos.util.io.FilterFileChannel |
checkReadAccess, checkWriteAccess, force, implCloseChannel, implCreateFileLock, map, position, position, read, read, read, size, transferFrom, transferTo, truncate, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LockProtectedFileChannel
public LockProtectedFileChannel(FileChannel inner)
- Parameters:
inner
-
lock
public FileLock lock(long position,
long size,
boolean shared)
throws IOException
- Overrides:
lock
in class FilterFileChannel
- Throws:
IOException
tryLock
public FileLock tryLock(long position,
long size,
boolean shared)
throws IOException
- Overrides:
tryLock
in class FilterFileChannel
- Throws:
IOException