|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.io.NOPReopener
public class NOPReopener
Implementation that will not re-open the FileChannel once it has been
closed. This is useful for simple things where you still want the reliability
guarentees of FileChannelUtility.
| Constructor Summary | |
|---|---|
NOPReopener(FileChannel channel)
|
|
NOPReopener(RandomAccessFile raf)
|
|
| Method Summary | |
|---|---|
FileChannel |
reopenChannel()
Transparently re-opens the FileChannel for the backing file if it
is closed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.bigdata.io.IReopenChannel |
|---|
toString |
| Constructor Detail |
|---|
public NOPReopener(FileChannel channel)
public NOPReopener(RandomAccessFile raf)
| Method Detail |
|---|
public FileChannel reopenChannel()
throws IOException
IReopenChannelFileChannel for the backing file if it
is closed.
Note: Java will close the backing FileChannel if a Thread
is 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
either an AsynchronousCloseException or an
ClosedChannelException. See FileChannelUtility which
knows how to handle this.
Note: This method MUST synchronized so that concurrent operations do not
try to re-open the FileChannel at the same time.
Note: While the FileChannel may be open within the implementation
of this method, it IS NOT possible guarenteed that it will be open by the
time you try to use it except by synchronizing all activity on that
FileChannel. 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.
reopenChannel in interface IReopenChannelFileChannel and never null.
IOException - if a required FileLock could not be obtained on a
platform and volume where FileLock is supported.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||