Class OrderedDownstreamThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor
org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor
org.jboss.netty.handler.execution.OrderedDownstreamThreadPoolExecutor
- All Implemented Interfaces:
Executor, ExecutorService
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.
For more informations about how the order is preserved see
OrderedMemoryAwareThreadPoolExecutor-
Nested Class Summary
Nested classes/interfaces inherited from class OrderedMemoryAwareThreadPoolExecutor
OrderedMemoryAwareThreadPoolExecutor.ChildExecutorNested classes/interfaces inherited from class ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Field Summary
Fields inherited from class OrderedMemoryAwareThreadPoolExecutor
childExecutors -
Constructor Summary
ConstructorsConstructorDescriptionOrderedDownstreamThreadPoolExecutor(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected ExecutorlongReturns0LlongReturns0LReturnnullvoidsetMaxChannelMemorySize(long maxChannelMemorySize) ThrowsUnsupportedOperationExceptionas there is not support for limit the memory size in this implementationvoidsetObjectSizeEstimator(ObjectSizeEstimator objectSizeEstimator) ThrowsUnsupportedOperationExceptionas there is not support for limit the memory size in this implementationprotected booleanshouldCount(Runnable task) Returnfalseas we not need to cound the memory in this implementationMethods inherited from class OrderedMemoryAwareThreadPoolExecutor
doExecute, getChildExecutorKey, getChildExecutorKeySet, newChildExecutorMap, onAfterExecute, removeChildExecutorMethods inherited from class MemoryAwareThreadPoolExecutor
beforeExecute, decreaseCounter, doUnorderedExecute, getNotifyChannelFuturesOnShutdown, increaseCounter, remove, setNotifyChannelFuturesOnShutdown, shutdownNow, shutdownNow, terminatedMethods inherited from class ThreadPoolExecutor
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, toStringMethods inherited from class AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Constructor Details
-
OrderedDownstreamThreadPoolExecutor
public OrderedDownstreamThreadPoolExecutor(int corePoolSize) Creates a new instance.- Parameters:
corePoolSize- the maximum number of active threads
-
OrderedDownstreamThreadPoolExecutor
-
OrderedDownstreamThreadPoolExecutor
public OrderedDownstreamThreadPoolExecutor(int corePoolSize, long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) Creates a new instance.- Parameters:
corePoolSize- the maximum number of active threadskeepAliveTime- the amount of time for an inactive thread to shut itself downunit- theTimeUnitofkeepAliveTimethreadFactory- theThreadFactoryof this pool
-
-
Method Details
-
getObjectSizeEstimator
Returnnull- Overrides:
getObjectSizeEstimatorin classMemoryAwareThreadPoolExecutor
-
setObjectSizeEstimator
ThrowsUnsupportedOperationExceptionas there is not support for limit the memory size in this implementation- Overrides:
setObjectSizeEstimatorin classMemoryAwareThreadPoolExecutor
-
getMaxChannelMemorySize
public long getMaxChannelMemorySize()Returns0L- Overrides:
getMaxChannelMemorySizein classMemoryAwareThreadPoolExecutor
-
setMaxChannelMemorySize
public void setMaxChannelMemorySize(long maxChannelMemorySize) ThrowsUnsupportedOperationExceptionas there is not support for limit the memory size in this implementation- Overrides:
setMaxChannelMemorySizein classMemoryAwareThreadPoolExecutor
-
getMaxTotalMemorySize
public long getMaxTotalMemorySize()Returns0L- Overrides:
getMaxTotalMemorySizein classMemoryAwareThreadPoolExecutor
-
shouldCount
Returnfalseas we not need to cound the memory in this implementation- Overrides:
shouldCountin classOrderedMemoryAwareThreadPoolExecutor
-
execute
- Specified by:
executein interfaceExecutor- Overrides:
executein classMemoryAwareThreadPoolExecutor
-
getChildExecutor
- Overrides:
getChildExecutorin classOrderedMemoryAwareThreadPoolExecutor
-