public final class OrderedDownstreamThreadPoolExecutor extends OrderedMemoryAwareThreadPoolExecutor
Executor
which should be used for downstream ChannelEvent
's. This implementation
will take care of preserve the order of the events in a Channel
. If you don't need to
preserve the order just use one of the Executor
implementations provided by the static
methods of Executors
.
OrderedMemoryAwareThreadPoolExecutor
OrderedMemoryAwareThreadPoolExecutor.ChildExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
childExecutors
Constructor and Description |
---|
OrderedDownstreamThreadPoolExecutor(int corePoolSize)
Creates a new instance.
|
OrderedDownstreamThreadPoolExecutor(int corePoolSize,
long keepAliveTime,
TimeUnit unit)
Creates a new instance.
|
OrderedDownstreamThreadPoolExecutor(int corePoolSize,
long keepAliveTime,
TimeUnit unit,
ThreadFactory threadFactory)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable command) |
protected Executor |
getChildExecutor(ChannelEvent e) |
long |
getMaxChannelMemorySize()
Returns
0L |
long |
getMaxTotalMemorySize()
Returns
0L |
ObjectSizeEstimator |
getObjectSizeEstimator()
Return
null |
void |
setMaxChannelMemorySize(long maxChannelMemorySize)
Throws
UnsupportedOperationException as there is not support for limit the memory
size in this implementation |
void |
setMaxTotalMemorySize(long maxTotalMemorySize)
Throws
UnsupportedOperationException as there is not support for limit the memory
size in this implementation |
void |
setObjectSizeEstimator(ObjectSizeEstimator objectSizeEstimator)
Throws
UnsupportedOperationException as there is not support for limit the memory
size in this implementation |
protected boolean |
shouldCount(Runnable task)
Return
false as we not need to cound the memory in this implementation |
doExecute, getChildExecutorKey, getChildExecutorKeySet, newChildExecutorMap, removeChildExecutor
beforeExecute, decreaseCounter, doUnorderedExecute, getNotifyChannelFuturesOnShutdown, increaseCounter, remove, setNotifyChannelFuturesOnShutdown, shutdownNow, shutdownNow, terminated
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public OrderedDownstreamThreadPoolExecutor(int corePoolSize)
corePoolSize
- the maximum number of active threadspublic OrderedDownstreamThreadPoolExecutor(int corePoolSize, long keepAliveTime, TimeUnit unit)
corePoolSize
- the maximum number of active threadskeepAliveTime
- the amount of time for an inactive thread to shut itself downunit
- the TimeUnit
of keepAliveTime
public OrderedDownstreamThreadPoolExecutor(int corePoolSize, long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory)
corePoolSize
- the maximum number of active threadskeepAliveTime
- the amount of time for an inactive thread to shut itself downunit
- the TimeUnit
of keepAliveTime
threadFactory
- the ThreadFactory
of this poolpublic ObjectSizeEstimator getObjectSizeEstimator()
null
getObjectSizeEstimator
in class MemoryAwareThreadPoolExecutor
public void setObjectSizeEstimator(ObjectSizeEstimator objectSizeEstimator)
UnsupportedOperationException
as there is not support for limit the memory
size in this implementationsetObjectSizeEstimator
in class MemoryAwareThreadPoolExecutor
public long getMaxChannelMemorySize()
0L
getMaxChannelMemorySize
in class MemoryAwareThreadPoolExecutor
public void setMaxChannelMemorySize(long maxChannelMemorySize)
UnsupportedOperationException
as there is not support for limit the memory
size in this implementationsetMaxChannelMemorySize
in class MemoryAwareThreadPoolExecutor
public long getMaxTotalMemorySize()
0L
getMaxTotalMemorySize
in class MemoryAwareThreadPoolExecutor
public void setMaxTotalMemorySize(long maxTotalMemorySize)
UnsupportedOperationException
as there is not support for limit the memory
size in this implementationsetMaxTotalMemorySize
in class MemoryAwareThreadPoolExecutor
protected boolean shouldCount(Runnable task)
false
as we not need to cound the memory in this implementationshouldCount
in class OrderedMemoryAwareThreadPoolExecutor
public void execute(Runnable command)
execute
in interface Executor
execute
in class MemoryAwareThreadPoolExecutor
protected Executor getChildExecutor(ChannelEvent e)
getChildExecutor
in class OrderedMemoryAwareThreadPoolExecutor
Copyright © 2008-2013 The Netty Project. All Rights Reserved.