V
- The result type of the I/O operationA
- The type of the object attached to the I/O operation
Created on Mar 27, 2012 at 10:27:33 AMpublic class CompletionHandlerAdapter<V,A> extends Object implements CompletionHandler<V,A>
CompletionHandlerAdapter
A handler adapter for consuming the result of an asynchronous I/O operation.
The asynchronous channels defined in this package allow a completion handler
to be specified to consume the result of an asynchronous operation. The
completed
method is invoked when the I/O operation
completes successfully. The failed
method is invoked if the
I/O operations fails. The implementations of these methods should complete in
a timely manner so as to avoid keeping the invoking thread from dispatching
to other completion handlers.
Constructor and Description |
---|
CompletionHandlerAdapter()
Create a new instance of
CompletionHandlerAdapter |
CompletionHandlerAdapter(Collection<CompletionHandler<? extends V,? extends A>> handlers)
Create a new instance of
CompletionHandlerAdapter |
CompletionHandlerAdapter(CompletionHandler<? extends V,? extends A> handler)
Create a new instance of
CompletionHandlerAdapter |
Modifier and Type | Method and Description |
---|---|
void |
completed(V result,
A attachment) |
void |
failed(Throwable exc,
A attachment) |
public CompletionHandlerAdapter()
CompletionHandlerAdapter
public CompletionHandlerAdapter(CompletionHandler<? extends V,? extends A> handler)
CompletionHandlerAdapter
handler
- public CompletionHandlerAdapter(Collection<CompletionHandler<? extends V,? extends A>> handlers)
CompletionHandlerAdapter
handlers
- Copyright © 2015 JBoss by Red Hat. All rights reserved.