public class NOPReopener extends Object implements IReopenChannel<FileChannel>
FileChannelonce it has been closed. This is useful for simple things where you still want the reliability guarantees of
|Constructor and Description|
|Modifier and Type||Method and Description|
Transparently re-opens the
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public NOPReopener(FileChannel channel)
public NOPReopener(RandomAccessFile raf)
public FileChannel reopenChannel() throws IOException
Channelif it is closed.
Note: Java will close the backing
Channel if a
interrupted during an NIO operation.
Note: This method MUST NOT be invoked if the channel was closed by an
interrupt in the caller's thread. The caller can detect
this condition by a thrown
ClosedByInterruptException rather than
AsynchronousCloseException or an
knows how to handle this.
Note: This method MUST synchronized so that concurrent operations do not
try to re-open the
Channel at the same time.
Note: While the
Channel may be open within the implementation of
this method, it IS NOT possible guaranteed that it will be open by the
time you try to use it except by synchronizing all activity on that
Channel. In general, that will limit throughput.
Note: Platforms and volumes (such as NFS) which DO NOT support
FileLock should re-open the file anyway without throwing an
exception. This behavior is required to run in those contexts.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.