com.taobao.metamorphosis.gregor.slave
类 OrderedThreadPoolExecutor

java.lang.Object
  继承者 java.util.concurrent.AbstractExecutorService
      继承者 java.util.concurrent.ThreadPoolExecutor
          继承者 com.taobao.metamorphosis.gregor.slave.OrderedThreadPoolExecutor
所有已实现的接口:
Executor, ExecutorService

public class OrderedThreadPoolExecutor
extends ThreadPoolExecutor

源自mina的OrderedThreadPoolExecutor,为适应notify remoting做了适当改造

作者:
boyan

嵌套类摘要
static class OrderedThreadPoolExecutor.TasksQueue
          A class used to store the ordered list of events to be processed by the session, and the current task state.
 
从类 java.util.concurrent.ThreadPoolExecutor 继承的嵌套类/接口
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
构造方法摘要
OrderedThreadPoolExecutor()
          Creates a default ThreadPool, with default values : - minimum pool size is 0 - maximum pool size is 16 - keepAlive set to 30 seconds - A default ThreadFactory - All events are accepted
OrderedThreadPoolExecutor(int maximumPoolSize)
          Creates a default ThreadPool, with default values : - minimum pool size is 0 - keepAlive set to 30 seconds - A default ThreadFactory - All events are accepted
OrderedThreadPoolExecutor(int corePoolSize, int maximumPoolSize)
          Creates a default ThreadPool, with default values : - keepAlive set to 30 seconds - A default ThreadFactory - All events are accepted
OrderedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit)
          Creates a default ThreadPool, with default values : - A default ThreadFactory - All events are accepted
OrderedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory)
          Creates a new instance of a OrderedThreadPoolExecutor.
OrderedThreadPoolExecutor(int corePoolSize, int maximumPoolSize, ThreadFactory threadFactory)
           
 
方法摘要
 boolean awaitTermination(long timeout, TimeUnit unit)
          
 void execute(Runnable task)
          
 int getActiveCount()
          
 long getCompletedTaskCount()
          
 int getCorePoolSize()
          
 int getLargestPoolSize()
          
 int getMaximumPoolSize()
          
 int getPoolSize()
          
 BlockingQueue<Runnable> getQueue()
          
 long getTaskCount()
          
 boolean isShutdown()
          
 boolean isTerminated()
          
 boolean isTerminating()
          
 int prestartAllCoreThreads()
          
 boolean prestartCoreThread()
          
 void purge()
          
 boolean remove(Runnable task)
          
 void setCorePoolSize(int corePoolSize)
          
 void setMaximumPoolSize(int maximumPoolSize)
          
 void setRejectedExecutionHandler(RejectedExecutionHandler handler)
          
 void shutdown()
          
 List<Runnable> shutdownNow()
          
 
从类 java.util.concurrent.ThreadPoolExecutor 继承的方法
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, beforeExecute, finalize, getKeepAliveTime, getRejectedExecutionHandler, getThreadFactory, setKeepAliveTime, setThreadFactory, terminated
 
从类 java.util.concurrent.AbstractExecutorService 继承的方法
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
 
从类 java.lang.Object 继承的方法
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

OrderedThreadPoolExecutor

public OrderedThreadPoolExecutor()
Creates a default ThreadPool, with default values : - minimum pool size is 0 - maximum pool size is 16 - keepAlive set to 30 seconds - A default ThreadFactory - All events are accepted


OrderedThreadPoolExecutor

public OrderedThreadPoolExecutor(int maximumPoolSize)
Creates a default ThreadPool, with default values : - minimum pool size is 0 - keepAlive set to 30 seconds - A default ThreadFactory - All events are accepted

参数:
maximumPoolSize - The maximum pool size

OrderedThreadPoolExecutor

public OrderedThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 ThreadFactory threadFactory)

OrderedThreadPoolExecutor

public OrderedThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize)
Creates a default ThreadPool, with default values : - keepAlive set to 30 seconds - A default ThreadFactory - All events are accepted

参数:
corePoolSize - The initial pool sizePoolSize
maximumPoolSize - The maximum pool size

OrderedThreadPoolExecutor

public OrderedThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 long keepAliveTime,
                                 TimeUnit unit)
Creates a default ThreadPool, with default values : - A default ThreadFactory - All events are accepted

参数:
corePoolSize - The initial pool sizePoolSize
maximumPoolSize - The maximum pool size
keepAliveTime - Default duration for a thread
unit - Time unit used for the keepAlive value

OrderedThreadPoolExecutor

public OrderedThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 long keepAliveTime,
                                 TimeUnit unit,
                                 ThreadFactory threadFactory)
Creates a new instance of a OrderedThreadPoolExecutor.

参数:
corePoolSize - The initial pool sizePoolSize
maximumPoolSize - The maximum pool size
keepAliveTime - Default duration for a thread
unit - Time unit used for the keepAlive value
threadFactory - The factory used to create threads
eventQueueHandler - The queue used to store events
方法详细信息

setRejectedExecutionHandler

public void setRejectedExecutionHandler(RejectedExecutionHandler handler)

覆盖:
ThreadPoolExecutor 中的 setRejectedExecutionHandler

getMaximumPoolSize

public int getMaximumPoolSize()

覆盖:
ThreadPoolExecutor 中的 getMaximumPoolSize

setMaximumPoolSize

public void setMaximumPoolSize(int maximumPoolSize)

覆盖:
ThreadPoolExecutor 中的 setMaximumPoolSize

awaitTermination

public boolean awaitTermination(long timeout,
                                TimeUnit unit)
                         throws InterruptedException

指定者:
接口 ExecutorService 中的 awaitTermination
覆盖:
ThreadPoolExecutor 中的 awaitTermination
抛出:
InterruptedException

isShutdown

public boolean isShutdown()

指定者:
接口 ExecutorService 中的 isShutdown
覆盖:
ThreadPoolExecutor 中的 isShutdown

isTerminated

public boolean isTerminated()

指定者:
接口 ExecutorService 中的 isTerminated
覆盖:
ThreadPoolExecutor 中的 isTerminated

shutdown

public void shutdown()

指定者:
接口 ExecutorService 中的 shutdown
覆盖:
ThreadPoolExecutor 中的 shutdown

shutdownNow

public List<Runnable> shutdownNow()

指定者:
接口 ExecutorService 中的 shutdownNow
覆盖:
ThreadPoolExecutor 中的 shutdownNow

execute

public void execute(Runnable task)

指定者:
接口 Executor 中的 execute
覆盖:
ThreadPoolExecutor 中的 execute

getActiveCount

public int getActiveCount()

覆盖:
ThreadPoolExecutor 中的 getActiveCount

getCompletedTaskCount

public long getCompletedTaskCount()

覆盖:
ThreadPoolExecutor 中的 getCompletedTaskCount

getLargestPoolSize

public int getLargestPoolSize()

覆盖:
ThreadPoolExecutor 中的 getLargestPoolSize

getPoolSize

public int getPoolSize()

覆盖:
ThreadPoolExecutor 中的 getPoolSize

getTaskCount

public long getTaskCount()

覆盖:
ThreadPoolExecutor 中的 getTaskCount

isTerminating

public boolean isTerminating()

覆盖:
ThreadPoolExecutor 中的 isTerminating

prestartAllCoreThreads

public int prestartAllCoreThreads()

覆盖:
ThreadPoolExecutor 中的 prestartAllCoreThreads

prestartCoreThread

public boolean prestartCoreThread()

覆盖:
ThreadPoolExecutor 中的 prestartCoreThread

getQueue

public BlockingQueue<Runnable> getQueue()

覆盖:
ThreadPoolExecutor 中的 getQueue

purge

public void purge()

覆盖:
ThreadPoolExecutor 中的 purge

remove

public boolean remove(Runnable task)

覆盖:
ThreadPoolExecutor 中的 remove

getCorePoolSize

public int getCorePoolSize()

覆盖:
ThreadPoolExecutor 中的 getCorePoolSize

setCorePoolSize

public void setCorePoolSize(int corePoolSize)

覆盖:
ThreadPoolExecutor 中的 setCorePoolSize


Copyright © 2010–2013. All rights reserved.