public < V > Future < V > submit ( Callable < V > task ) { Preconditions . checkState ( isOpen . get ( ) , "CloseableExecutorService is closed" ) ; InternalFutureTask < V > futureTask = new InternalFutureTask < V > ( new FutureTask < V > ( task ) ) ; executorService . execute ( futureTask ) ; return futureTask ; }
Submits a value - returning task for execution and returns a Future representing the pending results of the task . Upon completion this task may be taken or polled .