public class SharedBlockingCallback.Blocker extends Object implements Callback.NonBlocking, Closeable
Implements Callback.NonBlocking because calls to this callback do
not blocak, rather they wakeup the thread that is blocked in
block()
Callback.Completable, Callback.Nested, Callback.NonBlocking| 限定符 | 构造器和说明 |
|---|---|
protected |
Blocker() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
block()
Block until the Callback has succeeded or failed and after the return
leave in the state to allow reuse.
|
void |
close()
Check the Callback has succeeded or failed and after the return leave
in the state to allow reuse.
|
void |
failed(Throwable cause)
Callback invoked when the operation fails.
|
void |
succeeded()
Callback invoked when the operation completes.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisNonBlockingpublic void succeeded()
CallbackCallback invoked when the operation completes.
succeeded 在接口中 CallbackCallback.failed(Throwable)public void failed(Throwable cause)
CallbackCallback invoked when the operation fails.
public void block()
throws IOException
IOException - if exception was caught during blocking, or callback was
cancelledpublic void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableCopyright © 2016. All rights reserved.