There are two approaches to submitting and polling task for result
FutureTask futureTask = new FutureTask<String>(callable);
Use combination of
CallableandFutureand submit onExecutorService. Retrieve result usingfuture.get().Future future = service.submit(callable);Use
FutureTask. This will wrapCallableand then retrieve result usingFutureTask.service.execute(task);
What is the advantage of using FutureTask over Callable + Future combination ?
Almost certainly none at all. A quick browse on GrepCode of the
AbstractExecutorServiceshows each of these methods are simply helper methods that ultimately wrap theCallable/Runnablein aFuturefor you.