org.jboss.netty.handler.execution

## 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

      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`.
  For more informations about how the order is preserved see `OrderedMemoryAwareThreadPoolExecutor`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor

      `OrderedMemoryAwareThreadPoolExecutor.ChildExecutor`

    - ### 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.OrderedMemoryAwareThreadPoolExecutor

      `childExecutors`

  - ### Constructor Summary

    Constructors
    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.

  - ### Method Summary

    Methods
    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

    - ### Methods inherited from class org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor

      `doExecute, getChildExecutorKey, getChildExecutorKeySet, newChildExecutorMap, removeChildExecutor`

    - ### 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### OrderedDownstreamThreadPoolExecutor

          public OrderedDownstreamThreadPoolExecutor(int corePoolSize)

      Creates a new instance.
      Parameters:
        `corePoolSize` - the maximum number of active threads

    - #### OrderedDownstreamThreadPoolExecutor

          public OrderedDownstreamThreadPoolExecutor(int corePoolSize,
                                             long keepAliveTime,
                                             TimeUnit unit)

      Creates a new instance.
      Parameters:
        `corePoolSize` - the maximum number of active threads
        `keepAliveTime` - the amount of time for an inactive thread to shut itself down
        `unit` - the `TimeUnit` of `keepAliveTime`

    - #### OrderedDownstreamThreadPoolExecutor

          public OrderedDownstreamThreadPoolExecutor(int corePoolSize,
                                             long keepAliveTime,
                                             TimeUnit unit,
                                             ThreadFactory threadFactory)

      Creates a new instance.
      Parameters:
        `corePoolSize` - the maximum number of active threads
        `keepAliveTime` - the amount of time for an inactive thread to shut itself down
        `unit` - the `TimeUnit` of `keepAliveTime`
        `threadFactory` - the `ThreadFactory` of this pool

  - ### Method Detail

    - #### getObjectSizeEstimator

          public ObjectSizeEstimator getObjectSizeEstimator()

      Return `null`
      Overrides:
        `getObjectSizeEstimator` in class `MemoryAwareThreadPoolExecutor`

    - #### setObjectSizeEstimator

          public void setObjectSizeEstimator(ObjectSizeEstimator objectSizeEstimator)

      Throws `UnsupportedOperationException` as there is not support for limit the memory size in this implementation
      Overrides:
        `setObjectSizeEstimator` in class `MemoryAwareThreadPoolExecutor`

    - #### getMaxChannelMemorySize

          public long getMaxChannelMemorySize()

      Returns `0L`
      Overrides:
        `getMaxChannelMemorySize` in class `MemoryAwareThreadPoolExecutor`

    - #### setMaxChannelMemorySize

          public void setMaxChannelMemorySize(long maxChannelMemorySize)

      Throws `UnsupportedOperationException` as there is not support for limit the memory size in this implementation
      Overrides:
        `setMaxChannelMemorySize` in class `MemoryAwareThreadPoolExecutor`

    - #### getMaxTotalMemorySize

          public long getMaxTotalMemorySize()

      Returns `0L`
      Overrides:
        `getMaxTotalMemorySize` in class `MemoryAwareThreadPoolExecutor`

    - #### setMaxTotalMemorySize

          public void setMaxTotalMemorySize(long maxTotalMemorySize)

      Throws `UnsupportedOperationException` as there is not support for limit the memory size in this implementation
      Overrides:
        `setMaxTotalMemorySize` in class `MemoryAwareThreadPoolExecutor`

    - #### shouldCount

          protected boolean shouldCount(Runnable task)

      Return `false` as we not need to cound the memory in this implementation
      Overrides:
        `shouldCount` in class `OrderedMemoryAwareThreadPoolExecutor`

    - #### execute

          public void execute(Runnable command)

      Specified by:
        `execute` in interface `Executor`
      Overrides:
        `execute` in class `MemoryAwareThreadPoolExecutor`

    - #### getChildExecutor

          protected Executor getChildExecutor(ChannelEvent e)

      Overrides:
        `getChildExecutor` in class `OrderedMemoryAwareThreadPoolExecutor`

Copyright © 2008-2012 The Netty Project. All Rights Reserved.