Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable classes defined in this
package. This class supports the following kinds of methods:
ExecutorService
set up with commonly useful configuration settings.
ScheduledExecutorService
set up with commonly useful configuration settings.
ThreadFactory
that sets newly created threads to a known state.
Callable
out of other closure-like forms, so they can be used
in execution methods requiring Callable.
| Modifier and Type | Class and Description |
|---|---|
| private static class | Executors.
A DelegatedExecutorService that uses a Cleaner to shut down the underlying ExecutorService when the wrapper becomes phantom reachable. |
| private static class | Executors.
The default thread factory. |
| private static class | Executors.
A wrapper class that exposes only the ExecutorService methods of an ExecutorService implementation. |
| private static class | Executors.
A wrapper class that exposes only the ScheduledExecutorService methods of a ScheduledExecutorService implementation. |
| private static class | |
| private static class | Executors.
A callable that runs under established access control settings and current ClassLoader. |
| private static class | Executors.
Thread factory capturing the current class loader. |
| private static class |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type of the result T> Callable | |
| public static Callable | |
| public static Callable | Returns: a callable objectthe privileged action to run action)Returns a |
| public static Callable | Returns: a callable objectthe privileged exception action to run action)Returns a |
| public static ThreadFactory | Returns: a thread factoryReturns a default thread factory used to create new threads. |
| public static ExecutorService | Returns: the newly created thread poolCreates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available. |
| public static ExecutorService | Returns: the newly created thread poolthe factory to use when creating new threads 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. |
| public static ExecutorService | Returns: the newly created thread poolthe number of threads in the pool nThreads)Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue. |
| public static ExecutorService | Returns: the newly created thread poolthe number of threads in the pool nThreads, ThreadFactory the factory to use when creating new threads 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. |
| public static ScheduledExecutorService | Returns: the newly created scheduled thread poolthe number of threads to keep in the pool,
even if they are idle corePoolSize)Creates a fixed-size thread pool that can schedule commands to run after a given delay, or to execute periodically. |
| public static ScheduledExecutorService | Returns: the newly created scheduled thread poolthe number of threads to keep in the pool,
even if they are idle corePoolSize, ThreadFactory the factory to use when the executor
creates a new thread threadFactory)Creates a fixed-size thread pool that can schedule commands to run after a given delay, or to execute periodically. |
| public static ExecutorService | Returns: the newly created single-threaded ExecutorCreates an Executor that uses a single worker thread operating off an unbounded queue. |
| public static ExecutorService | Returns: the newly created single-threaded Executorthe factory to use when creating new threads 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. |
| public static ScheduledExecutorService | Returns: the newly created scheduled executorCreates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically. |
| public static ScheduledExecutorService | Returns: the newly created scheduled executorthe factory to use when creating new threads threadFactory)Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically. |
| public static ExecutorService | Returns: a new executor that creates a new Thread for each taskthe factory to use when creating new threads threadFactory)Creates an Executor that starts a new Thread for each task. |
| public static ExecutorService | Returns: a new executor that creates a new virtual Thread for each taskCreates an Executor that starts a new virtual Thread for each task. |
| public static ExecutorService | Returns: the newly created thread poolthe targeted parallelism level parallelism)Creates a thread pool that maintains enough threads to support the given parallelism level, and may use multiple queues to reduce contention. |
| public static ExecutorService | Returns: the newly created thread poolCreates a work-stealing thread pool using the number of available processors as its target parallelism level. |
| public static < the type of the callable's result T> Callable | Returns: a callable objectthe underlying task callable)
Deprecated
for removal since 17. This method originally returned a
Callable object
that when called, executed the given callable under the
current access control context.
Returns a |
| public static < the type of the callable's result T> Callable | Returns: a callable objectthe underlying task callable)
Deprecated
for removal since 17. This method originally returned a
Callable object
that when called, executed the given callable under the
current access control context, with the current context class
loader as the context class loader.
Returns a |
| public static ThreadFactory | Returns: a thread factory
Deprecated
for removal since 17. This method originally returned a thread factory that
created new threads that had the same access control context
as the current thread.
Returns a thread factory used to create new threads that have the current context class loader as the context class loader. |
| public static ExecutorService | Returns: anExecutorService instancethe underlying implementation executor)Returns an object that delegates all defined |
| public static ScheduledExecutorService | Returns: aScheduledExecutorService instancethe underlying implementation executor)Returns an object that delegates all defined |