| Package | Description |
|---|---|
| java.nio.channels |
Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.
|
| java.nio.channels.spi |
Service-provider classes for the
java.nio.channels package.
|
| java.util.concurrent |
Utility classes commonly useful in concurrent programming.
|
| Modifier and Type | Method and Description |
|---|---|
static AsynchronousChannelGroup |
AsynchronousChannelGroup.withFixedThreadPool(int nThreads, ThreadFactory
Creates an asynchronous channel group with a fixed thread pool.
|
| Modifier and Type | Method and Description |
|---|---|
abstract AsynchronousChannelGroup |
AsynchronousChannelProvider.openAsynchronousChannelGroup(int nThreads, ThreadFactory
Constructs a new asynchronous channel group with a fixed thread pool.
|
| Modifier and Type | Method and Description |
|---|---|
static ThreadFactory |
Executors.defaultThreadFactory()
Returns a default thread factory used to create new threads.
|
ThreadFactory |
ThreadPoolExecutor.getThreadFactory()
Returns the thread factory used to create new threads.
|
static ThreadFactory |
Executors.privilegedThreadFactory()
Returns a thread factory used to create new threads that have the same permissions as the current thread.
|
| Modifier and Type | Method and Description |
|---|---|
static ExecutorService |
Executors.newCachedThreadPool(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.
|
static ExecutorService |
Executors.newFixedThreadPool(int nThreads, 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.
|
static ScheduledExecutorService |
Executors.newScheduledThreadPool(int corePoolSize, ThreadFactory
Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.
|
static ExecutorService |
Executors.newSingleThreadExecutor(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.
|
static ScheduledExecutorService |
Executors.newSingleThreadScheduledExecutor(ThreadFactory
Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.
|
void |
ThreadPoolExecutor.setThreadFactory(ThreadFactory
Sets the thread factory used to create new threads.
|
| Constructor and Description | |
|---|---|
ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory
Creates a new
ScheduledThreadPoolExecutor with the given initial parameters.
|
|
ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory
Creates a new ScheduledThreadPoolExecutor with the given initial parameters.
|
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit
Creates a new
ThreadPoolExecutor with the given initial parameters and default rejected execution handler.
|
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit
Creates a new
ThreadPoolExecutor with the given initial parameters.
|