@Target(value=METHOD) @Retention(value=RUNTIME) @Inherited public @interface ThreadPool
| 限定符和类型 | 必需的元素和说明 |
|---|---|
int |
corePoolSize
the number of threads to keep in the pool
|
long |
keepAliveTime
when the number of threads is greater than the core,
this is the maximum time that excess idle threads
will wait for new tasks before terminating.
|
int |
maximumPoolSize
the maximum number of threads to allow in the pool
|
| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
group
the same group will use the same one executor
|
Class<RejectedExecutionHandler> |
handler
the handler to use when execution is blocked
because the thread bounds and queue capacities are reached
|
String |
name
thread name prefix
|
Class<ThreadFactory> |
threadFactory |
TimeUnit |
timeUnit
the time unit for the keepAliveTime argument
|
Class<? extends BlockingQueue> |
workQueue
the queue to use for holding tasks before they are executed.
|
public abstract int maximumPoolSize
public abstract long keepAliveTime
public abstract String name
public abstract String group
public abstract Class<ThreadFactory> threadFactory
public abstract TimeUnit timeUnit
public abstract Class<? extends BlockingQueue> workQueue
public abstract Class<RejectedExecutionHandler> handler
Copyright © 2017. All rights reserved.