1 package org.onap.sdc.dcae.catalog.commons;
3 import org.onap.sdc.dcae.catalog.commons.Future;
4 import org.onap.sdc.dcae.catalog.commons.FutureHandler;
7 * Modeled after the vertx future
9 public interface Future<T> {
13 public Future<T> result(T theResult);
15 //rename 'cause' to 'failure'
17 public Throwable cause();
19 public Future<T> cause(Throwable theError);
21 public boolean succeeded();
23 public boolean failed();
25 public boolean complete();
27 public T waitForResult() throws Exception;
29 //public T waitForResult(long theTimeout) throws Exception;
31 public Future<T> waitForCompletion() throws InterruptedException;
33 public Future<T> setHandler(FutureHandler<T> theHandler);