public final class UnorderedThreadPoolEventExecutor extends java.util.concurrent.ScheduledThreadPoolExecutor implements EventExecutor
EventExecutor implementation which makes no guarantees about the ordering of task execution that
are submitted because there may be multiple threads executing these tasks.
This implementation is most useful for protocols that do not need strict ordering.
Because it provides no ordering care should be taken when using it!| 构造器和说明 |
|---|
UnorderedThreadPoolEventExecutor(int corePoolSize)
|
UnorderedThreadPoolEventExecutor(int corePoolSize,
java.util.concurrent.RejectedExecutionHandler handler)
|
UnorderedThreadPoolEventExecutor(int corePoolSize,
java.util.concurrent.ThreadFactory threadFactory)
See
ScheduledThreadPoolExecutor.ScheduledThreadPoolExecutor(int, ThreadFactory) |
UnorderedThreadPoolEventExecutor(int corePoolSize,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.RejectedExecutionHandler handler)
See
ScheduledThreadPoolExecutor.ScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler) |
| 限定符和类型 | 方法和说明 |
|---|---|
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()
Calls
EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument |
boolean |
inEventLoop(java.lang.Thread thread)
Return
true if the given Thread is executed in the event loop,
false otherwise. |
boolean |
isShuttingDown()
Returns
true if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down. |
java.util.Iterator<EventExecutor> |
iterator() |
<V> Future<V> |
newFailedFuture(java.lang.Throwable cause)
Create a new
Future which is marked as failed already. |
<V> ProgressivePromise<V> |
newProgressivePromise()
Create a new
ProgressivePromise. |
<V> Promise<V> |
newPromise()
Return a new
Promise. |
<V> Future<V> |
newSucceededFuture(V result)
Create a new
Future which is marked as succeeded already. |
EventExecutor |
next()
Returns a reference to itself.
|
EventExecutorGroup |
parent()
Return the
EventExecutorGroup which is the parent of this EventExecutor, |
<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()
Shortcut method for
EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values. |
Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
java.util.concurrent.TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.
|
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()
Returns the
Future which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated. |
getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicyafterExecute, 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, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskForpublic 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()
EventExecutornext 在接口中 EventExecutornext 在接口中 EventExecutorGrouppublic EventExecutorGroup parent()
EventExecutorEventExecutorGroup which is the parent of this EventExecutor,parent 在接口中 EventExecutorpublic boolean inEventLoop()
EventExecutorEventExecutor.inEventLoop(Thread) with Thread.currentThread() as argumentinEventLoop 在接口中 EventExecutorpublic boolean inEventLoop(java.lang.Thread thread)
EventExecutortrue if the given Thread is executed in the event loop,
false otherwise.inEventLoop 在接口中 EventExecutorpublic <V> Promise<V> newPromise()
EventExecutorPromise.newPromise 在接口中 EventExecutorpublic <V> ProgressivePromise<V> newProgressivePromise()
EventExecutorProgressivePromise.newProgressivePromise 在接口中 EventExecutorpublic <V> Future<V> newSucceededFuture(V result)
EventExecutorFuture which is marked as succeeded already. So Future.isSuccess()
will return true. All FutureListener added to it will be notified directly. Also
every call of blocking methods will just return without blocking.newSucceededFuture 在接口中 EventExecutorpublic <V> Future<V> newFailedFuture(java.lang.Throwable cause)
EventExecutorFuture which is marked as failed already. So Future.isSuccess()
will return false. All FutureListener added to it will be notified directly. Also
every call of blocking methods will just return without blocking.newFailedFuture 在接口中 EventExecutorpublic boolean isShuttingDown()
EventExecutorGrouptrue if and only if all EventExecutors managed by this EventExecutorGroup
are being shut down gracefully or was shut down.isShuttingDown 在接口中 EventExecutorGrouppublic java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow 在接口中 EventExecutorGroupshutdownNow 在接口中 java.util.concurrent.ExecutorServiceshutdownNow 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic void shutdown()
shutdown 在接口中 EventExecutorGroupshutdown 在接口中 java.util.concurrent.ExecutorServiceshutdown 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic Future<?> shutdownGracefully()
EventExecutorGroupEventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values.shutdownGracefully 在接口中 EventExecutorGroupEventExecutorGroup.terminationFuture()public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
EventExecutorGroupEventExecutorGroup.isShuttingDown() starts to return true, and the executor prepares to shut itself down.
Unlike EventExecutorGroup.shutdown(), graceful shutdown ensures that no tasks are submitted for 'the quiet period'
(usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period,
it is guaranteed to be accepted and the quiet period will start over.shutdownGracefully 在接口中 EventExecutorGroupquietPeriod - the quiet period as described in the documentationtimeout - the maximum amount of time to wait until the executor is EventExecutorGroup.shutdown()
regardless if a task was submitted during the quiet periodunit - the unit of quietPeriod and timeoutEventExecutorGroup.terminationFuture()public Future<?> terminationFuture()
EventExecutorGroupFuture which is notified when all EventExecutors managed by this
EventExecutorGroup have been terminated.terminationFuture 在接口中 EventExecutorGrouppublic java.util.Iterator<EventExecutor> iterator()
iterator 在接口中 EventExecutorGroupiterator 在接口中 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.ScheduledThreadPoolExecutorprotected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.util.concurrent.Callable<V> callable,
java.util.concurrent.RunnableScheduledFuture<V> task)
decorateTask 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
schedule 在接口中 EventExecutorGroupschedule 在接口中 java.util.concurrent.ScheduledExecutorServiceschedule 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic <V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
schedule 在接口中 EventExecutorGroupschedule 在接口中 java.util.concurrent.ScheduledExecutorServiceschedule 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
scheduleAtFixedRate 在接口中 EventExecutorGroupscheduleAtFixedRate 在接口中 java.util.concurrent.ScheduledExecutorServicescheduleAtFixedRate 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
scheduleWithFixedDelay 在接口中 EventExecutorGroupscheduleWithFixedDelay 在接口中 java.util.concurrent.ScheduledExecutorServicescheduleWithFixedDelay 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic Future<?> submit(java.lang.Runnable task)
submit 在接口中 EventExecutorGroupsubmit 在接口中 java.util.concurrent.ExecutorServicesubmit 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic <T> Future<T> submit(java.lang.Runnable task, T result)
submit 在接口中 EventExecutorGroupsubmit 在接口中 java.util.concurrent.ExecutorServicesubmit 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic <T> Future<T> submit(java.util.concurrent.Callable<T> task)
submit 在接口中 EventExecutorGroupsubmit 在接口中 java.util.concurrent.ExecutorServicesubmit 在类中 java.util.concurrent.ScheduledThreadPoolExecutorpublic void execute(java.lang.Runnable command)
execute 在接口中 java.util.concurrent.Executorexecute 在类中 java.util.concurrent.ScheduledThreadPoolExecutor