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:
java.util.concurrent.Executor,java.util.concurrent.ExecutorService
public final class FairOrderedDownstreamThreadPoolExecutor extends FairOrderedMemoryAwareThreadPoolExecutor
This is a fair alternative ofOrderedDownstreamThreadPoolExecutor.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
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
-
Field Summary
-
Fields inherited from class org.jboss.netty.handler.execution.FairOrderedMemoryAwareThreadPoolExecutor
map
-
-
Constructor Summary
Constructors Constructor Description FairOrderedDownstreamThreadPoolExecutor(int corePoolSize)Creates a new instance.FairOrderedDownstreamThreadPoolExecutor(int corePoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit)Creates a new instance.FairOrderedDownstreamThreadPoolExecutor(int corePoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.ThreadFactory threadFactory)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(java.lang.Runnable task)Executes the specified task concurrently while maintaining the event order.voidexecute(java.lang.Runnable command)longgetMaxChannelMemorySize()Returns0LlonggetMaxTotalMemorySize()Returns0LObjectSizeEstimatorgetObjectSizeEstimator()ReturnnullvoidsetMaxChannelMemorySize(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(java.lang.Runnable task)Returnfalseas we not need to count the memory in this implementation-
Methods 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
-
-
-
-
Constructor Detail
-
FairOrderedDownstreamThreadPoolExecutor
public FairOrderedDownstreamThreadPoolExecutor(int corePoolSize)
Creates a new instance.- Parameters:
corePoolSize- the maximum number of active threads
-
FairOrderedDownstreamThreadPoolExecutor
public FairOrderedDownstreamThreadPoolExecutor(int corePoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit)Creates a new instance.- Parameters:
corePoolSize- the maximum number of active threadskeepAliveTime- the amount of time for an inactive thread to shut itself downunit- theTimeUnitofkeepAliveTime
-
FairOrderedDownstreamThreadPoolExecutor
public FairOrderedDownstreamThreadPoolExecutor(int corePoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.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 Detail
-
getObjectSizeEstimator
public ObjectSizeEstimator getObjectSizeEstimator()
Returnnull- Overrides:
getObjectSizeEstimatorin classMemoryAwareThreadPoolExecutor
-
setObjectSizeEstimator
public void setObjectSizeEstimator(ObjectSizeEstimator objectSizeEstimator)
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
protected boolean shouldCount(java.lang.Runnable task)
Returnfalseas we not need to count the memory in this implementation- Overrides:
shouldCountin classFairOrderedMemoryAwareThreadPoolExecutor
-
execute
public void execute(java.lang.Runnable command)
- Specified by:
executein interfacejava.util.concurrent.Executor- Overrides:
executein classMemoryAwareThreadPoolExecutor
-
doExecute
protected void doExecute(java.lang.Runnable task)
Executes the specified task concurrently while maintaining the event order.- Overrides:
doExecutein classFairOrderedMemoryAwareThreadPoolExecutor
-
-