public interface 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 |
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.IOException
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
- void closeSilently()
GrizzlyFuture<Closeable> close()
Future
, which could be checked in case, if close operation
will be run asynchronouslyvoid 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
- void addCloseListener(CloseListener closeListener)
CloseListener
, which will be notified once the stream
will be closed.closeListener
- CloseListener
.boolean removeCloseListener(CloseListener closeListener)
CloseListener
.closeListener
- CloseListener
.Copyright © 2015 Oracle Corporation. All rights reserved.