org.apache.activemq.util
Class Promise<T>

java.lang.Object
  extended by org.apache.activemq.util.PromiseCallback<T>
      extended by org.apache.activemq.util.Promise<T>

public class Promise<T>
extends PromiseCallback<T>

Used to implement callback based result passing of a promised computation. Can be converted to a future using the future() method.

Author:
Hiram Chirino

Constructor Summary
Promise()
           
 
Method Summary
 Future<T> future()
           
 void onComplete(T value, Throwable error)
           
 void watch(PromiseCallback<T> callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Promise

public Promise()
Method Detail

future

public Future<T> future()

watch

public void watch(PromiseCallback<T> callback)

onComplete

public void onComplete(T value,
                       Throwable error)
Specified by:
onComplete in class PromiseCallback<T>


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.