Java Thread Executor Execute executeFuture(Callable callable)

Here you can find the source of executeFuture(Callable callable)

Description

execute Future

License

Apache License

Declaration

public static <T> Future<T> executeFuture(Callable<T> callable) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.concurrent.*;

public class Main {
    private static ExecutorService executorThreadPool = Executors.newCachedThreadPool();

    public static <T> Future<T> executeFuture(Callable<T> callable) {
        return executorThreadPool.submit(callable);
    }//from   w  w  w  .j  av  a 2 s . com
}

Related

  1. execute(Runnable task)
  2. execute(String name, Runnable runnable)
  3. executeAndWait(final Runnable r)
  4. executeAsynchronously(Runnable r)
  5. executeForever(final Runnable runnable)
  6. executeInCachedPool(Runnable runnable)
  7. executeInThread(Runnable r)
  8. executeInThreadPool(Runnable runnable)
  9. executeParallel(final List> callables, final int maxThreadCount)