public class UnorderedThreadPoolExecutor extends ThreadPoolExecutor
ThreadPoolExecutor that does not maintain the order of IoEvents.
This means more than one event handler methods can be invoked at the same
time with mixed order. For example, let's assume that messageReceived, messageSent,
and sessionClosed events are fired.
OrderedThreadPoolExecutor.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
UnorderedThreadPoolExecutor()
Creates a new UnorderedThreadPoolExecutor instance
|
UnorderedThreadPoolExecutor(int maximumPoolSize)
Creates a new UnorderedThreadPoolExecutor instance
|
UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize)
Creates a new UnorderedThreadPoolExecutor instance
|
UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit)
Creates a new UnorderedThreadPoolExecutor instance
|
UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
IoEventQueueHandler queueHandler)
Creates a new UnorderedThreadPoolExecutor instance
|
UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
ThreadFactory threadFactory)
Creates a new UnorderedThreadPoolExecutor instance
|
UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
ThreadFactory threadFactory,
IoEventQueueHandler queueHandler)
Creates a new UnorderedThreadPoolExecutor instance
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
execute(Runnable task) |
int |
getActiveCount() |
long |
getCompletedTaskCount() |
int |
getCorePoolSize() |
int |
getLargestPoolSize() |
int |
getMaximumPoolSize() |
int |
getPoolSize() |
IoEventQueueHandler |
getQueueHandler() |
long |
getTaskCount() |
boolean |
isShutdown() |
boolean |
isTerminated() |
boolean |
isTerminating() |
int |
prestartAllCoreThreads() |
boolean |
prestartCoreThread() |
void |
purge() |
boolean |
remove(Runnable task) |
void |
setCorePoolSize(int corePoolSize) |
void |
setMaximumPoolSize(int maximumPoolSize) |
void |
setRejectedExecutionHandler(RejectedExecutionHandler handler) |
void |
shutdown() |
List<Runnable> |
shutdownNow() |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, beforeExecute, finalize, getKeepAliveTime, getQueue, getRejectedExecutionHandler, getThreadFactory, setKeepAliveTime, setThreadFactory, terminated, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic UnorderedThreadPoolExecutor()
public UnorderedThreadPoolExecutor(int maximumPoolSize)
maximumPoolSize - The maximum number of threads in the poolpublic UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize)
corePoolSize - The initial threads pool sizemaximumPoolSize - The maximum number of threads in the poolpublic UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit)
corePoolSize - The initial threads pool sizemaximumPoolSize - The maximum number of threads in the poolkeepAliveTime - The time to keep threads aliveunit - The time unit for the keepAliveTimepublic UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
IoEventQueueHandler queueHandler)
corePoolSize - The initial threads pool sizemaximumPoolSize - The maximum number of threads in the poolkeepAliveTime - The time to keep threads aliveunit - The time unit for the keepAliveTimequeueHandler - The Event queue handler to usepublic UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
ThreadFactory threadFactory)
corePoolSize - The initial threads pool sizemaximumPoolSize - The maximum number of threads in the poolkeepAliveTime - The time to keep threads aliveunit - The time unit for the keepAliveTimethreadFactory - The Thread factory to usepublic UnorderedThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
ThreadFactory threadFactory,
IoEventQueueHandler queueHandler)
corePoolSize - The initial threads pool sizemaximumPoolSize - The maximum number of threads in the poolkeepAliveTime - The time to keep threads aliveunit - The time unit for the keepAliveTimethreadFactory - The Thread factory to usequeueHandler - The Event queue handler to usepublic IoEventQueueHandler getQueueHandler()
public void setRejectedExecutionHandler(RejectedExecutionHandler handler)
setRejectedExecutionHandler in class ThreadPoolExecutorpublic int getMaximumPoolSize()
getMaximumPoolSize in class ThreadPoolExecutorpublic void setMaximumPoolSize(int maximumPoolSize)
setMaximumPoolSize in class ThreadPoolExecutorpublic boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface ExecutorServiceawaitTermination in class ThreadPoolExecutorInterruptedExceptionpublic boolean isShutdown()
isShutdown in interface ExecutorServiceisShutdown in class ThreadPoolExecutorpublic boolean isTerminated()
isTerminated in interface ExecutorServiceisTerminated in class ThreadPoolExecutorpublic void shutdown()
shutdown in interface ExecutorServiceshutdown in class ThreadPoolExecutorpublic List<Runnable> shutdownNow()
shutdownNow in interface ExecutorServiceshutdownNow in class ThreadPoolExecutorpublic void execute(Runnable task)
execute in interface Executorexecute in class ThreadPoolExecutorpublic int getActiveCount()
getActiveCount in class ThreadPoolExecutorpublic long getCompletedTaskCount()
getCompletedTaskCount in class ThreadPoolExecutorpublic int getLargestPoolSize()
getLargestPoolSize in class ThreadPoolExecutorpublic int getPoolSize()
getPoolSize in class ThreadPoolExecutorpublic long getTaskCount()
getTaskCount in class ThreadPoolExecutorpublic boolean isTerminating()
isTerminating in class ThreadPoolExecutorpublic int prestartAllCoreThreads()
prestartAllCoreThreads in class ThreadPoolExecutorpublic boolean prestartCoreThread()
prestartCoreThread in class ThreadPoolExecutorpublic void purge()
purge in class ThreadPoolExecutorpublic boolean remove(Runnable task)
remove in class ThreadPoolExecutorpublic int getCorePoolSize()
getCorePoolSize in class ThreadPoolExecutorpublic void setCorePoolSize(int corePoolSize)
setCorePoolSize in class ThreadPoolExecutorCopyright © 2004–2024 Apache MINA Project. All rights reserved.