Class AsyncFuture.AbstractListener<T,A>

java.lang.Object
org.jboss.threads.AsyncFuture.AbstractListener<T,A>
Type Parameters:
T - the future type
A - the attachment type
All Implemented Interfaces:
EventListener, AsyncFuture.Listener<T,A>
Enclosing interface:
AsyncFuture<T>

public abstract static class AsyncFuture.AbstractListener<T,A> extends Object implements AsyncFuture.Listener<T,A>
An abstract base class for an implementation of the Listener interface. The implementation methods do nothing unless overridden.
Author:
David M. Lloyd
  • Constructor Details

    • AbstractListener

      public AbstractListener()
  • Method Details

    • handleComplete

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

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

      public void handleCancelled(AsyncFuture<? extends T> future, A attachment)
      Handle a cancellation result.
      Specified by:
      handleCancelled in interface AsyncFuture.Listener<T,A>
      Parameters:
      future - the future
      attachment - the attachment