|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
R - the result typeA - the attachment typepublic interface CompletionHandler<R,A>
A handler for consuming the result of an asynchronous operation.
The asynchronous channels defined in this package allow a completion
handler to be specified to consume the result of an asynchronous
operation. When an operation completes the handler's
completed method is invoked with the result.
InetSocketAddress addr = ...
AsynchronousSocketChannel ch = AsynchronousSocketChannel.open();
ch.connect(addr, new CompletionHandler<Void,Void>() {
public void completed(IoFuture<Void,Void> result) {
try {
result.getNow();
// connection established
} catch (ExecutionException x) {
...
}
}
});
| Method Summary | |
|---|---|
void |
completed(IoFuture<R,A> result)
Invoked when an operation has completed. |
| Method Detail |
|---|
void completed(IoFuture<R,A> result)
The result parameter is an IoFuture representing the
result of the operation. Its getNow method
should be invoked to retrieve the result.
This method should complete in a timely manner so as to avoid keeping this thread from dispatching to other completion handlers.
result - the IoFuture representing the result of the
operation
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||