|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IReopenChannel
Interface for objects which know how to re-open the backing
FileChannel for some resource and also understand when the resource
has been closed and therefore should not be reopened. This is used in
combination with FileChannelUtility to support the transparent
re-opening of a file whose channel was closed asynchronously by an interrupt
in another thread during an NIO operation.
| Method Summary | |
|---|---|
FileChannel |
reopenChannel()
Transparently re-opens the FileChannel for the backing file if it
is closed. |
String |
toString()
Should include the name of the backing file (if known). |
| Method Detail |
|---|
FileChannel reopenChannel()
throws IOException
FileChannel 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.
FileChannel and never null.
IllegalStateException - if the resource has been closed and is therefore no longer
permitting reads or writes on the file.
IOException - if a required FileLock could not be obtained on a
platform and volume where FileLock is supported.String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||