public class Executors extends Object
Executor
ExecutorService
ScheduledExecutorService
ThreadFactory
Callable
ExecutorService
ScheduledExecutorService
ThreadFactory
Callable
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static ExecutorService newFixedThreadPool(int nThreads)
shutdown
nThreads
IllegalArgumentException
nThreads <= 0
public static ExecutorService newFixedThreadPool(int nThreads, ThreadFactory threadFactory)
shutdown
nThreads
threadFactory
NullPointerException
IllegalArgumentException
nThreads <= 0
public static ExecutorService newSingleThreadExecutor()
public static ExecutorService newSingleThreadExecutor( ThreadFactory threadFactory)
threadFactory
NullPointerException
public static ExecutorService newCachedThreadPool()
ThreadPoolExecutor
public static ExecutorService newCachedThreadPool( ThreadFactory threadFactory)
threadFactory
NullPointerException
public static ScheduledExecutorService newSingleThreadScheduledExecutor()
public static ScheduledExecutorService newSingleThreadScheduledExecutor( ThreadFactory threadFactory)
threadFactory
NullPointerException
public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize)
corePoolSize
IllegalArgumentException
corePoolSize < 0
public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize, ThreadFactory threadFactory)
corePoolSize
threadFactory
IllegalArgumentException
corePoolSize < 0
NullPointerException
public static ExecutorService unconfigurableExecutorService( ExecutorService executor)
ExecutorService
executor
NullPointerException
public static ScheduledExecutorService unconfigurableScheduledExecutorService( ScheduledExecutorService executor)
ScheduledExecutorService
executor
NullPointerException
public static ThreadFactory defaultThreadFactory()
ThreadGroup
SecurityManager
System.getSecurityManager()
Thread.getName()
public static ThreadFactory privilegedThreadFactory()
defaultThreadFactory()
AccessController.doPrivileged(java.security.PrivilegedAction<T>)
AccessControlException
public static <T> Callable <T> callable( Runnable task, T result)
Callable
task
result
NullPointerException
public static Callable < Object > callable( Runnable task)
task
NullPointerException
public static Callable < Object > callable( PrivilegedAction <?> action)
Callable
action
NullPointerException
public static Callable < Object > callable( PrivilegedExceptionAction <?> action)
Callable
action
NullPointerException
public static <T> Callable <T> privilegedCallable( Callable <T> callable)
Callable
AccessController.doPrivileged(java.security.PrivilegedAction<T>)
AccessControlException
callable
NullPointerException
public static <T> Callable <T> privilegedCallableUsingCurrentClassLoader( Callable <T> callable)
Callable
AccessController.doPrivileged(java.security.PrivilegedAction<T>)
AccessControlException
callable
NullPointerException
AccessControlException