Interface AsyncFuture.Listener<T,A>
- Type Parameters:
T- the future typeA- the attachment type
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
AsyncFuture.AbstractListener
- Enclosing interface:
AsyncFuture<T>
A listener for an asynchronous future computation result. Each listener method is passed the
AsyncFuture which it was added to, as well as the attachment which was passed in to
AsyncFuture.addListener(Listener, Object).- Author:
- David M. Lloyd
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleCancelled(AsyncFuture<? extends T> future, A attachment) Handle a cancellation result.voidhandleComplete(AsyncFuture<? extends T> future, A attachment) Handle a successful computation result.voidhandleFailed(AsyncFuture<? extends T> future, Throwable cause, A attachment) Handle a failure result.
-
Method Details
-
handleComplete
Handle a successful computation result.- Parameters:
future- the futureattachment- the attachment
-
handleFailed
Handle a failure result.- Parameters:
future- the futurecause- the reason for the failureattachment- the attachment
-
handleCancelled
Handle a cancellation result.- Parameters:
future- the futureattachment- the attachment
-