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()
CompletionHandlercancelled in interface CompletionHandler<B>public void failed(Throwable throwable)
CompletionHandlerfailed in interface CompletionHandler<B>throwable - error, which occurred during operation executionpublic void completed(B result)
CompletionHandlercompleted 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)
CompletionHandlerupdated 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 © 2017–2019 Oracle Corporation. All rights reserved.