软件包 | 描述 |
---|---|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
java.nio.channels.spi |
为
java.nio.channels 包服务提供商类。
|
java.util.concurrent |
在并发编程中常用的实用类。
|
Modifier and Type | Method and Description |
---|---|
static AsynchronousChannelGroup |
AsynchronousChannelGroup.withFixedThreadPool(int nThreads, ThreadFactory threadFactory)
创建一个固定的线程池的异步信道组。
|
Modifier and Type | Method and Description |
---|---|
abstract AsynchronousChannelGroup |
AsynchronousChannelProvider.openAsynchronousChannelGroup(int nThreads, ThreadFactory threadFactory)
用固定的线程池构造一个新的异步信道组。
|
Modifier and Type | Method and Description |
---|---|
static ThreadFactory |
Executors.defaultThreadFactory()
返回用于创建新线程的默认线程工厂。
|
ThreadFactory |
ThreadPoolExecutor.getThreadFactory()
返回用于创建新线程的线程工厂。
|
static ThreadFactory |
Executors.privilegedThreadFactory()
返回一个用于创建与当前线程具有相同权限的新线程的线程工厂。
|
Modifier and Type | Method and Description |
---|---|
static ExecutorService |
Executors.newCachedThreadPool(ThreadFactory threadFactory)
创建一个线程池线程创建新的需要,但会重用以前构建的线程可用时,使用所提供的threadfactory创建新线程时,需要。
|
static ExecutorService |
Executors.newFixedThreadPool(int nThreads, ThreadFactory threadFactory)
创建一个线程池,使用固定数量的线程操作了共享无界队列,使用提供的threadfactory创建新线程时,需要。
|
static ScheduledExecutorService |
Executors.newScheduledThreadPool(int corePoolSize, ThreadFactory threadFactory)
创建一个线程池,可以调度命令在一个给定的延迟后运行,或周期性地执行。
|
static ExecutorService |
Executors.newSingleThreadExecutor(ThreadFactory threadFactory)
创建一个执行器,采用单线程操作了无界队列,并使用所提供的threadfactory创建新线程需要时。
|
static ScheduledExecutorService |
Executors.newSingleThreadScheduledExecutor(ThreadFactory threadFactory)
创建一个单线程的执行器,可以调度命令在一个给定的延迟后运行,或周期性地执行。
|
void |
ThreadPoolExecutor.setThreadFactory(ThreadFactory threadFactory)
设置用于创建新线程的线程工厂。
|
Constructor and Description |
---|
ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory)
创建具有给定的初始参数的一种新
ScheduledThreadPoolExecutor 。
|
ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
创建具有给定的初始参数的一种新scheduledthreadpoolexecutor。
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
创建一个新的
ThreadPoolExecutor 与给定的初始参数和默认拒绝执行处理程序。
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)
创建具有给定的初始参数的一种新
ThreadPoolExecutor 。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.