Java Thread Executor Execute executeInCachedPool(Runnable runnable)

Here you can find the source of executeInCachedPool(Runnable runnable)

Description

execute In Cached Pool

License

Open Source License

Declaration

public static Future<?> executeInCachedPool(Runnable runnable) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;

import java.util.concurrent.Future;

public class Main {
    private static ExecutorService CACHED_THREAD_POOL;

    public static Future<?> executeInCachedPool(Runnable runnable) {
        Future<?> future = CACHED_THREAD_POOL.submit(runnable);
        return future;
    }//from   w ww .j a  va  2 s .com

    public static <V> Future<V> executeInCachedPool(Callable<V> callable) {
        Future<V> future = CACHED_THREAD_POOL.submit(callable);
        return future;
    }
}

Related

  1. execute(String name, Runnable runnable)
  2. executeAndWait(final Runnable r)
  3. executeAsynchronously(Runnable r)
  4. executeForever(final Runnable runnable)
  5. executeFuture(Callable callable)
  6. executeInThread(Runnable r)
  7. executeInThreadPool(Runnable runnable)
  8. executeParallel(final List> callables, final int maxThreadCount)
  9. executePeriodicallyInThread(Runnable r, int delay, int period, TimeUnit unit)