Class FairOrderedDownstreamThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor
org.jboss.netty.handler.execution.FairOrderedMemoryAwareThreadPoolExecutor
org.jboss.netty.handler.execution.FairOrderedDownstreamThreadPoolExecutor
- All Implemented Interfaces:
Executor
,ExecutorService
public final class FairOrderedDownstreamThreadPoolExecutor
extends FairOrderedMemoryAwareThreadPoolExecutor
This is a fair alternative of
OrderedDownstreamThreadPoolExecutor
.
For more information about how the order is preserved
see FairOrderedMemoryAwareThreadPoolExecutor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.netty.handler.execution.FairOrderedMemoryAwareThreadPoolExecutor
FairOrderedMemoryAwareThreadPoolExecutor.EventTask
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
Field Summary
Fields inherited from class org.jboss.netty.handler.execution.FairOrderedMemoryAwareThreadPoolExecutor
map
-
Constructor Summary
ConstructorsConstructorDescriptionFairOrderedDownstreamThreadPoolExecutor
(int corePoolSize) Creates a new instance.FairOrderedDownstreamThreadPoolExecutor
(int corePoolSize, long keepAliveTime, TimeUnit unit) Creates a new instance.FairOrderedDownstreamThreadPoolExecutor
(int corePoolSize, long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Executes the specified task concurrently while maintaining the event order.void
long
Returns0L
long
Returns0L
Returnnull
void
setMaxChannelMemorySize
(long maxChannelMemorySize) ThrowsUnsupportedOperationException
as there is not support for limit the memory size in this implementationvoid
setObjectSizeEstimator
(ObjectSizeEstimator objectSizeEstimator) ThrowsUnsupportedOperationException
as there is not support for limit the memory size in this implementationprotected boolean
shouldCount
(Runnable task) Returnfalse
as we not need to count the memory in this implementationMethods inherited from class org.jboss.netty.handler.execution.FairOrderedMemoryAwareThreadPoolExecutor
compareAndSetNext, getKey, newMap, removeKey
Methods inherited from class org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor
beforeExecute, decreaseCounter, doUnorderedExecute, getNotifyChannelFuturesOnShutdown, increaseCounter, remove, setNotifyChannelFuturesOnShutdown, shutdownNow, shutdownNow, terminated
Methods inherited from class java.util.concurrent.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, toString
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Constructor Details
-
FairOrderedDownstreamThreadPoolExecutor
public FairOrderedDownstreamThreadPoolExecutor(int corePoolSize) Creates a new instance.- Parameters:
corePoolSize
- the maximum number of active threads
-
FairOrderedDownstreamThreadPoolExecutor
Creates a new instance.- Parameters:
corePoolSize
- the maximum number of active threadskeepAliveTime
- the amount of time for an inactive thread to shut itself downunit
- theTimeUnit
ofkeepAliveTime
-
FairOrderedDownstreamThreadPoolExecutor
public FairOrderedDownstreamThreadPoolExecutor(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
- theTimeUnit
ofkeepAliveTime
threadFactory
- theThreadFactory
of this pool
-
-
Method Details
-
getObjectSizeEstimator
Returnnull
- Overrides:
getObjectSizeEstimator
in classMemoryAwareThreadPoolExecutor
-
setObjectSizeEstimator
ThrowsUnsupportedOperationException
as there is not support for limit the memory size in this implementation- Overrides:
setObjectSizeEstimator
in classMemoryAwareThreadPoolExecutor
-
getMaxChannelMemorySize
public long getMaxChannelMemorySize()Returns0L
- Overrides:
getMaxChannelMemorySize
in classMemoryAwareThreadPoolExecutor
-
setMaxChannelMemorySize
public void setMaxChannelMemorySize(long maxChannelMemorySize) ThrowsUnsupportedOperationException
as there is not support for limit the memory size in this implementation- Overrides:
setMaxChannelMemorySize
in classMemoryAwareThreadPoolExecutor
-
getMaxTotalMemorySize
public long getMaxTotalMemorySize()Returns0L
- Overrides:
getMaxTotalMemorySize
in classMemoryAwareThreadPoolExecutor
-
shouldCount
Returnfalse
as we not need to count the memory in this implementation- Overrides:
shouldCount
in classFairOrderedMemoryAwareThreadPoolExecutor
-
execute
- Specified by:
execute
in interfaceExecutor
- Overrides:
execute
in classMemoryAwareThreadPoolExecutor
-
doExecute
Executes the specified task concurrently while maintaining the event order.- Overrides:
doExecute
in classFairOrderedMemoryAwareThreadPoolExecutor
-