1 17 package org.apache.servicemix.beanflow; 18 19 import java.util.concurrent.Callable ; 20 import java.util.concurrent.Executor ; 21 import java.util.concurrent.Future ; 22 import java.util.concurrent.FutureTask ; 23 24 29 public class CallableActivity<T> extends AsynchronousActivity { 30 31 private final Future <T> future; 32 33 public CallableActivity(Executor executor, Callable <T> callable) { 34 this(executor, new FutureTask <T>(callable)); 35 } 36 37 public CallableActivity(Executor executor, FutureTask <T> futureTask) { 38 super(executor, futureTask); 39 this.future = futureTask; 40 } 41 42 45 public Future <T> getFuture() { 46 return future; 47 } 48 49 } 50 | Popular Tags |