Interface AsyncFuture.Listener<T,A>

Type Parameters:
T - the future type
A - the attachment type
All Superinterfaces:
EventListener
All Known Implementing Classes:
AsyncFuture.AbstractListener
Enclosing interface:
AsyncFuture<T>

public static interface AsyncFuture.Listener<T,A> extends EventListener
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 Details

    • handleComplete

      void handleComplete(AsyncFuture<? extends T> future, A attachment)
      Handle a successful computation result.
      Parameters:
      future - the future
      attachment - the attachment
    • handleFailed

      void handleFailed(AsyncFuture<? extends T> future, Throwable cause, A attachment)
      Handle a failure result.
      Parameters:
      future - the future
      cause - the reason for the failure
      attachment - the attachment
    • handleCancelled

      void handleCancelled(AsyncFuture<? extends T> future, A attachment)
      Handle a cancellation result.
      Parameters:
      future - the future
      attachment - the attachment