JBoss Threads 2.0.0.GA-redhat-2

org.jboss.threads
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).


Method Summary
 void handleCancelled(AsyncFuture<? extends T> future, A attachment)
          Handle a cancellation result.
 void handleComplete(AsyncFuture<? extends T> future, A attachment)
          Handle a successful computation result.
 void handleFailed(AsyncFuture<? extends T> future, Throwable cause, A attachment)
          Handle a failure result.
 

Method Detail

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

JBoss Threads 2.0.0.GA-redhat-2

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.