T
- the type that is passed to the close handlerpublic interface HandleableCloseable<T> extends Closeable
Modifier and Type | Interface and Description |
---|---|
static interface |
HandleableCloseable.Key
A key which may be used to remove this handler.
|
Modifier and Type | Method and Description |
---|---|
HandleableCloseable.Key |
addCloseHandler(CloseHandler<? super T> handler)
Add a handler that will be called upon close.
|
void |
awaitClosed()
Wait for a resource close to complete.
|
void |
awaitClosedUninterruptibly()
Wait for a resource close to complete.
|
void |
close()
Close this resource.
|
void |
closeAsync()
Asynchronously close this resource.
|
boolean |
isOpen()
Read the status of this resource.
|
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
- if the close failedvoid awaitClosed() throws InterruptedException
InterruptedException
- if the operation is interruptedvoid awaitClosedUninterruptibly()
void closeAsync()
HandleableCloseable.Key addCloseHandler(CloseHandler<? super T> handler)
handler
- the close handlerboolean isOpen()
true
.true
if the resource is still openCopyright © 2019 JBoss by Red Hat. All rights reserved.