API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent. Executors View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Object
      Executors
Implements
Subclasses
Description
public class Executors
  Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable classes defined in this package.
See also:   
Constructors
private Executors ()
Cannot instantiate.
Methods
Hide/Show inherited methods
publicstatic Callable<Object> callable (PrivilegedAction<Object> action)
  Returns a Callable object that, when called, runs the given privileged action and returns its result.
publicstatic Callable<Object> callable (PrivilegedExceptionAction<Object> action)
  Returns a Callable object that, when called, runs the given privileged exception action and returns its result.
publicstatic Callable<Object> callable (Runnable task)
  Returns a Callable object that, when called, runs the given task and returns null.
publicstatic Callable< T> callable (Runnable task, T result)
  Returns a Callable object that, when called, runs the given task and returns the given result.
publicstatic ThreadFactory defaultThreadFactory ()
  Returns a default thread factory used to create new threads.
publicstatic ExecutorService newCachedThreadPool ()
  Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available.
publicstatic ExecutorService newCachedThreadPool (ThreadFactory threadFactory)
  Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available, and uses the provided ThreadFactory to create new threads when needed.
publicstatic ExecutorService newFixedThreadPool (int nThreads)
  Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue.
publicstatic ExecutorService newFixedThreadPool (int nThreads, ThreadFactory threadFactory)
  Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue, using the provided ThreadFactory to create new threads when needed.
publicstatic ScheduledExecutorService newScheduledThreadPool (int corePoolSize)
  Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.
publicstatic ScheduledExecutorService newScheduledThreadPool (int corePoolSize, ThreadFactory threadFactory)
  Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.
publicstatic ExecutorService newSingleThreadExecutor ()
  Creates an Executor that uses a single worker thread operating off an unbounded queue.
publicstatic ExecutorService newSingleThreadExecutor (ThreadFactory threadFactory)
  Creates an Executor that uses a single worker thread operating off an unbounded queue, and uses the provided ThreadFactory to create a new thread when needed.
publicstatic ScheduledExecutorService newSingleThreadScheduledExecutor ()
  Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.
publicstatic ScheduledExecutorService newSingleThreadScheduledExecutor (ThreadFactory threadFactory)
  Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.
publicstatic Callable< T> privilegedCallable (Callable< T> callable)
  Returns a Callable object that will, when called, execute the given callable under the current access control context.
publicstatic Callable< T> privilegedCallableUsingCurrentClassLoader (Callable< T> callable)
  Returns a Callable object that will, when called, execute the given callable under the current access control context, with the current context class loader as the context class loader.
publicstatic ThreadFactory privilegedThreadFactory ()
  Returns a thread factory used to create new threads that have the same permissions as the current thread.
publicstatic ExecutorService unconfigurableExecutorService (ExecutorService executor)
  Returns an object that delegates all defined ExecutorService methods to the given executor, but not any other methods that might otherwise be accessible using casts.
publicstatic ScheduledExecutorService unconfigurableScheduledExecutorService (ScheduledExecutorService executor)
  Returns an object that delegates all defined ScheduledExecutorService methods to the given executor, but not any other methods that might otherwise be accessible using casts.
Fields
Hide/Show inherited fields
Nested Classes
  Executors.RunnableAdapter
A callable that runs given task and returns given result
  Executors.PrivilegedCallable
A callable that runs under established access control settings
  Executors.PrivilegedCallableUsingCurrentClassLoader
A callable that runs under established access control settings and current ClassLoader
  Executors.DefaultThreadFactory
The default thread factory
  Executors.PrivilegedThreadFactory
Thread factory capturing access control and class loader
  Executors.DelegatedExecutorService
A wrapper class that exposes only the ExecutorService methods of an ExecutorService implementation.
  Executors.FinalizableDelegatedExecutorService
  Executors.DelegatedScheduledExecutorService
A wrapper class that exposes only the ScheduledExecutorService methods of a ScheduledExecutorService implementation.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar