public final class UnorderedThreadPoolEventExecutor extends java.util.concurrent.ScheduledThreadPoolExecutor implements EventExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
UnorderedThreadPoolEventExecutor(int corePoolSize)
|
UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.RejectedExecutionHandler handler)
|
UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory)
见
ScheduledThreadPoolExecutor.ScheduledThreadPoolExecutor(int, ThreadFactory)
|
UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler)
见
ScheduledThreadPoolExecutor.ScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler)
|
Modifier and Type | Method and Description |
---|---|
protected <V> java.util.concurrent.RunnableScheduledFuture<V> |
decorateTask(java.util.concurrent.Callable<V> callable, java.util.concurrent.RunnableScheduledFuture<V> task) |
protected <V> java.util.concurrent.RunnableScheduledFuture<V> |
decorateTask(java.lang.Runnable runnable, java.util.concurrent.RunnableScheduledFuture<V> task) |
void |
execute(java.lang.Runnable command) |
boolean |
inEventLoop()
以
Thread.currentThread() 作为参数调用
EventExecutor.inEventLoop(Thread)
|
boolean |
inEventLoop(java.lang.Thread thread)
返回
true 如果给定
Thread 在事件循环中执行,
false 其他。
|
boolean |
isShuttingDown()
返回 true 当且仅当所有EventExecutor 由该被管小号EventExecutorGroup 正在shut down gracefully或者被关闭。
|
java.util.Iterator<EventExecutor> |
iterator() |
<V> Future<V> |
newFailedFuture(java.lang.Throwable cause)
|
<V> ProgressivePromise<V> |
newProgressivePromise()
创建一个新的 ProgressivePromise 。
|
<V> Promise<V> |
newPromise()
返回一个新的 Promise 。
|
<V> Future<V> |
newSucceededFuture(V result)
|
EventExecutor |
next()
返回对自身的引用。
|
EventExecutorGroup |
parent()
返回此 EventExecutor 的父级EventExecutorGroup ,
|
<V> ScheduledFuture<V> |
schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit) |
ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit) |
void |
shutdown() |
Future<?> |
shutdownGracefully()
|
Future<?> |
shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
该执行者表示该调用者希望执行者被关闭。
|
java.util.List<java.lang.Runnable> |
shutdownNow() |
<T> Future<T> |
submit(java.util.concurrent.Callable<T> task) |
Future<?> |
submit(java.lang.Runnable task) |
<T> Future<T> |
submit(java.lang.Runnable task, T result) |
Future<?> |
terminationFuture()
返回 Future ,当由EventExecutorGroup 管理的所有EventExecutor 已终止时,通知Future 。
|
getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public UnorderedThreadPoolEventExecutor(int corePoolSize)
public UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory)
ScheduledThreadPoolExecutor.ScheduledThreadPoolExecutor(int, ThreadFactory)
public UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.RejectedExecutionHandler handler)
public UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler)
ScheduledThreadPoolExecutor.ScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler)
public EventExecutor next()
EventExecutor
复制的描述
next
,界面
EventExecutor
next
,界面
EventExecutorGroup
public EventExecutorGroup parent()
EventExecutor
复制的描述
EventExecutor
的父级EventExecutorGroup
,
parent
接口
EventExecutor
public boolean inEventLoop()
EventExecutor
Thread.currentThread()
作为参数调用
EventExecutor.inEventLoop(Thread)
inEventLoop
接口
EventExecutor
public boolean inEventLoop(java.lang.Thread thread)
EventExecutor
复制的描述
true
如果给定
Thread
在事件循环中执行,
false
其他。
inEventLoop
,界面
EventExecutor
public <V> Promise<V> newPromise()
EventExecutor
复制的描述
Promise
。
newPromise
接口
EventExecutor
public <V> ProgressivePromise<V> newProgressivePromise()
EventExecutor
复制的描述
ProgressivePromise
。
newProgressivePromise
,界面
EventExecutor
public <V> Future<V> newSucceededFuture(V result)
EventExecutor
复制的描述
Future
。
所以Future.isSuccess()
将返回true
。
所有添加到它的FutureListener
将直接通知。
同样,每个阻塞方法的调用都会返回而不会阻塞。
newSucceededFuture
接口
EventExecutor
public <V> Future<V> newFailedFuture(java.lang.Throwable cause)
EventExecutor
Future
。
所以Future.isSuccess()
将返回false
。
所有添加到它的FutureListener
将直接通知。
同样,每个阻塞方法的调用都会返回而不会阻塞。
newFailedFuture
,界面
EventExecutor
public boolean isShuttingDown()
EventExecutorGroup
复制的描述
true
当且仅当EventExecutorGroup
管理的所有EventExecutor
都是shut down gracefully或被关闭。
isShuttingDown
接口
EventExecutorGroup
public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
在界面
EventExecutorGroup
shutdownNow
,界面
java.util.concurrent.ExecutorService
shutdownNow
,课时
java.util.concurrent.ScheduledThreadPoolExecutor
public void shutdown()
shutdown
,界面
EventExecutorGroup
shutdown
,界面
java.util.concurrent.ExecutorService
shutdown
在课堂上
java.util.concurrent.ScheduledThreadPoolExecutor
public Future<?> shutdownGracefully()
EventExecutorGroup
shutdownGracefully
,界面
EventExecutorGroup
EventExecutorGroup.terminationFuture()
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
EventExecutorGroup
复制的描述
EventExecutorGroup.isShuttingDown()
开始返回true
,并且执行程序准备关闭它。
与EventExecutorGroup.shutdown()
不同,正常关机可确保在关闭之前没有任何任务被提交“安静期” (通常是几秒钟)。
如果任务在安静期提交,则保证被接受,安静期将重新开始。
shutdownGracefully
,界面
EventExecutorGroup
quietPeriod
- 文档中描述的安静期
timeout
- 无论任务是否在静默期间提交,等待执行程序为
EventExecutorGroup.shutdown()的最长时间
unit
-
quietPeriod
和
timeout
的单位
EventExecutorGroup.terminationFuture()
public Future<?> terminationFuture()
EventExecutorGroup
Future
,当此EventExecutorGroup
管理的所有EventExecutor
已终止时将通知该Future
。
terminationFuture
,界面
EventExecutorGroup
public java.util.Iterator<EventExecutor> iterator()
iterator
接口
EventExecutorGroup
iterator
在界面
java.lang.Iterable<EventExecutor>
protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.lang.Runnable runnable, java.util.concurrent.RunnableScheduledFuture<V> task)
decorateTask
在课堂上
java.util.concurrent.ScheduledThreadPoolExecutor
protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.util.concurrent.Callable<V> callable, java.util.concurrent.RunnableScheduledFuture<V> task)
decorateTask
在课堂
java.util.concurrent.ScheduledThreadPoolExecutor
public ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule
,界面
EventExecutorGroup
schedule
,界面
java.util.concurrent.ScheduledExecutorService
schedule
在课堂
java.util.concurrent.ScheduledThreadPoolExecutor
public <V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule
,界面
EventExecutorGroup
schedule
在界面
java.util.concurrent.ScheduledExecutorService
schedule
在课堂
java.util.concurrent.ScheduledThreadPoolExecutor
public ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate
,界面
EventExecutorGroup
scheduleAtFixedRate
接口
java.util.concurrent.ScheduledExecutorService
scheduleAtFixedRate
在课堂
java.util.concurrent.ScheduledThreadPoolExecutor
public ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay
接口
EventExecutorGroup
scheduleWithFixedDelay
接口
java.util.concurrent.ScheduledExecutorService
scheduleWithFixedDelay
在课堂
java.util.concurrent.ScheduledThreadPoolExecutor
public Future<?> submit(java.lang.Runnable task)
submit
在界面
EventExecutorGroup
submit
,界面
java.util.concurrent.ExecutorService
submit
在课程
java.util.concurrent.ScheduledThreadPoolExecutor
public <T> Future<T> submit(java.lang.Runnable task, T result)
submit
,界面
EventExecutorGroup
submit
在界面
java.util.concurrent.ExecutorService
submit
,课时
java.util.concurrent.ScheduledThreadPoolExecutor
public <T> Future<T> submit(java.util.concurrent.Callable<T> task)
submit
,界面
EventExecutorGroup
submit
,界面
java.util.concurrent.ExecutorService
submit
在课堂
java.util.concurrent.ScheduledThreadPoolExecutor
public void execute(java.lang.Runnable command)
execute
,界面
java.util.concurrent.Executor
execute
in class
java.util.concurrent.ScheduledThreadPoolExecutor
Copyright © 2008–2018 The Netty Project. All rights reserved.