This method will do its best to expedite the shutdown process. In particular, all connections will be closed right away, even if there is ongoing queries at the time this method is called.
Note that this method does not block. The completion of this method does not imply the shutdown process is done, you still need to wait on this future to ensure that, but calling this method will ensure said future will return in a timely way. @return this {@code CloseFuture}.
If the file mapped into this buffer resides on a local storage device then when this method returns it is guaranteed that all changes made to the buffer since it was created, or since this method was last invoked, will have been written to that device.
If the file does not reside on a local device then no such guarantee is made.
If this buffer was not mapped in read/write mode ( {@link java.nio.channels.FileChannel.MapMode#READ_WRITE}) then invoking this method has no effect.
@return This bufferWhen this method returns all modifications made to the platform file underlying this channel will be committed to a local storage device. If the file is not hosted locally, such as a networked file system, then applications cannot be certain that the modifications have been committed.
There are no assurances given that changes made to the file using methods defined elsewhere will be committed. For example, changes made via a mapped byte buffer may not be committed.
The metadata
parameter indicated whether the update should include the file's metadata such as last modification time, last access time, etc. Note that passing true
may invoke an underlying write to the operating system (if the platform is maintaining metadata such as last access time), even if the channel is opened read-only.
@param metadata true if the file metadata should be flushed in addition to the file content, and false otherwise.
@throws ClosedChannelException if the channel is already closed.
@throws IOException some other problem occured.
|
|