public class CompletionHandlerAdapter<A,B> extends Object implements CompletionHandler<B>
Constructor and Description |
---|
CompletionHandlerAdapter(FutureImpl<A> future) |
CompletionHandlerAdapter(FutureImpl<A> future,
CompletionHandler<A> completionHandler) |
CompletionHandlerAdapter(FutureImpl<A> future,
CompletionHandler<A> completionHandler,
GenericAdapter<B,A> adapter) |
Modifier and Type | Method and Description |
---|---|
protected A |
adapt(B result) |
void |
cancelled()
The operation was cancelled.
|
void |
completed(B result)
The operation was completed.
|
void |
failed(Throwable throwable)
The operation was failed.
|
void |
updated(B result)
The callback method may be called, when there is some progress in
operation execution, but it is still not completed
|
public CompletionHandlerAdapter(FutureImpl<A> future)
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler)
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B,A> adapter)
public void cancelled()
CompletionHandler
cancelled
in interface CompletionHandler<B>
public void failed(Throwable throwable)
CompletionHandler
failed
in interface CompletionHandler<B>
throwable
- error, which occurred during operation executionpublic void completed(B result)
CompletionHandler
completed
in interface CompletionHandler<B>
result
- the operation result
Please note, for performance reasons the result object might be recycled
after returning from the completed method. So it's not guaranteed that
using of the result object is safe outside this method's scope.public void updated(B result)
CompletionHandler
updated
in interface CompletionHandler<B>
result
- the current result
Please note, for performance reasons the result object might be recycled
after returning from the updated method. So it's not guaranteed that
using of the result object is safe outside this method's scope.Copyright © 2015 Oracle Corporation. All rights reserved.