软件包 | 描述 |
---|---|
java.util.concurrent |
在并发编程中常用的实用类。
|
Modifier and Type | Class and Description |
---|---|
static class |
ThreadPoolExecutor.AbortPolicy
对于拒绝任务,抛出一个
RejectedExecutionException 处理程序。
|
static class |
ThreadPoolExecutor.CallerRunsPolicy
对于拒绝任务运行任务直接拒绝的
execute 方法调用的线程处理,除非遗嘱执行人已被关闭,在这种情况下,任务被丢弃。
|
static class |
ThreadPoolExecutor.DiscardOldestPolicy
对于拒绝任务,抛弃了古老的未经处理的请求,然后重试
execute 处理程序,除非遗嘱执行人是关闭的,在这种情况下,任务被丢弃。
|
static class |
ThreadPoolExecutor.DiscardPolicy
对于拒绝任务,默默丢弃拒绝任务处理程序。
|
Modifier and Type | Method and Description |
---|---|
RejectedExecutionHandler |
ThreadPoolExecutor.getRejectedExecutionHandler()
返回当前可执行任务的处理程序。
|
Modifier and Type | Method and Description |
---|---|
void |
ThreadPoolExecutor.setRejectedExecutionHandler(RejectedExecutionHandler handler)
设置为可执行的任务的一个新的处理程序。
|
Constructor and Description |
---|
ScheduledThreadPoolExecutor(int corePoolSize, RejectedExecutionHandler handler)
创建具有给定的初始参数的一种新scheduledthreadpoolexecutor。
|
ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
创建具有给定的初始参数的一种新scheduledthreadpoolexecutor。
|
ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
创建具有给定的初始参数和默认线厂一个新的
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.