public interface Closeable
Closeable| Modifier and Type | Method and Description |
|---|---|
void |
addCloseListener(CloseListener closeListener)
Add the
CloseListener, which will be notified once the stream will be closed. |
void |
assertOpen()
Checks if this Closeable is open and ready to be used.
|
GrizzlyFuture<Closeable> |
close()
Gracefully (if supported by the implementation) closes this stream and releases any system resources associated with
it.
|
void |
close(CompletionHandler<Closeable> completionHandler)
Deprecated.
please use
close() with the following
GrizzlyFuture.addCompletionHandler(org.glassfish.grizzly.CompletionHandler) call |
GrizzlyFuture<CloseReason> |
closeFuture() |
void |
closeSilently()
Gracefully (if supported by the implementation) closes this stream and releases any system resources associated with
it.
|
void |
closeWithReason(IOException cause)
Gracefully closes the Closeable and provides the reason description.
|
boolean |
isOpen()
Is Closeable open and ready.
|
boolean |
removeCloseListener(CloseListener closeListener)
Remove the
CloseListener. |
GrizzlyFuture<Closeable> |
terminate()
Closes this stream and releases any system resources associated with it.
|
void |
terminateSilently()
Closes this stream and releases any system resources associated with it.
|
void |
terminateWithReason(IOException cause)
Closes the Closeable and provides the reason description.
|
boolean isOpen()
void assertOpen()
throws IOException
IOException - giving the reason why this Closeable was closed.void terminateSilently()
GrizzlyFuture<Closeable> terminate()
Future, which could be checked in case, if close operation will be run
asynchronouslyvoid terminateWithReason(IOException cause)
terminateSilently(), but additionally provides the reason why the
Closeable will be closed.cause - reason why terminated. This will be thrown is isOpen() is called subsequentlyvoid closeSilently()
GrizzlyFuture<Closeable> close()
Future, which could be checked in case, if close operation will be run
asynchronouslywhich is not asynchronous@Deprecated void close(CompletionHandler<Closeable> completionHandler)
close() with the following
GrizzlyFuture.addCompletionHandler(org.glassfish.grizzly.CompletionHandler) callcompletionHandler - CompletionHandler to be called, when the stream is closedvoid closeWithReason(IOException cause)
closeSilently(), but additionally provides the reason why the Closeable
will be closed.cause - reason why closed, this will be thrown by isOpen() if called subsequentlyvoid addCloseListener(CloseListener closeListener)
CloseListener, which will be notified once the stream will be closed.closeListener - CloseListener.boolean removeCloseListener(CloseListener closeListener)
CloseListener.closeListener - CloseListener.GrizzlyFuture<CloseReason> closeFuture()
Future, that will be notified once this Closeable is closedCopyright © 2017–2020 Oracle Corporation. All rights reserved.