com.sun.grizzly.http
Class StatsThreadPool

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by com.sun.grizzly.util.DefaultThreadPool
              extended by com.sun.grizzly.http.StatsThreadPool
All Implemented Interfaces:
ExtendedThreadPool, Thread.UncaughtExceptionHandler, Executor, ExecutorService

public class StatsThreadPool
extends DefaultThreadPool

Internal FIFO used by the Worker Threads to pass information between Task objects.

Author:
Jean-Francois Arcand

Nested Class Summary
protected  class StatsThreadPool.HttpWorkerThreadFactory
          Create new HttpWorkerThread.
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
Field Summary
protected  int port
          Port, which is served by this thread pool
protected  ThreadPoolStatistic threadPoolStat
          The ThreadPoolStatistic objects used when gathering statistics.
 
Fields inherited from class com.sun.grizzly.util.DefaultThreadPool
byteBufferType, DEFAULT_IDLE_THREAD_KEEPALIVE_TIMEOUT, DEFAULT_MAX_TASKS_QUEUED, DEFAULT_MAX_THREAD_COUNT, DEFAULT_MIN_THREAD_COUNT, initialByteBufferSize, maxTasksCount, name, priority, workerThreadCounter
 
Constructor Summary
StatsThreadPool()
           
StatsThreadPool(int maxTasksCount)
           
StatsThreadPool(int corePoolSize, int maximumPoolSize, int maxTasksCount, long keepAliveTime, TimeUnit unit)
           
 
Method Summary
 int getPort()
          Get the port number, which is served by the thread pool
 ThreadPoolStatistic getStatistic()
          Return the ThreadPoolStatistic object used to gather statistic;
protected  void injectToStringAttributes(StringBuilder sb)
           
 void setPort(int port)
          Set the port number, which is served by the thread pool
 void setStatistic(ThreadPoolStatistic threadPoolStatistic)
          Set the ThreadPoolStatistic object used to gather statistic;
 String toString()
           
 
Methods inherited from class com.sun.grizzly.util.DefaultThreadPool
afterExecute, beforeExecute, getByteBufferType, getInitialByteBufferSize, getMaxQueuedTasksCount, getName, getPriority, getQueuedTasksCount, getQueueSize, setByteBufferType, setInitialByteBufferSize, setMaxQueuedTasksCount, setName, setPriority, start, stop, uncaughtException
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated
 
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
 
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
 
Methods inherited from interface java.util.concurrent.Executor
execute
 
Methods inherited from interface com.sun.grizzly.util.ExtendedThreadPool
getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getTaskCount, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize
 

Field Detail

port

protected int port
Port, which is served by this thread pool


threadPoolStat

protected transient ThreadPoolStatistic threadPoolStat
The ThreadPoolStatistic objects used when gathering statistics.

Constructor Detail

StatsThreadPool

public StatsThreadPool()

StatsThreadPool

public StatsThreadPool(int maxTasksCount)

StatsThreadPool

public StatsThreadPool(int corePoolSize,
                       int maximumPoolSize,
                       int maxTasksCount,
                       long keepAliveTime,
                       TimeUnit unit)
Method Detail

getPort

public int getPort()
Get the port number, which is served by the thread pool

Returns:
the port number, which is served by the thread pool

setPort

public void setPort(int port)
Set the port number, which is served by the thread pool

Parameters:
port - the port number, which is served by the thread pool

setStatistic

public void setStatistic(ThreadPoolStatistic threadPoolStatistic)
Set the ThreadPoolStatistic object used to gather statistic;


getStatistic

public ThreadPoolStatistic getStatistic()
Return the ThreadPoolStatistic object used to gather statistic;


toString

public String toString()
Overrides:
toString in class DefaultThreadPool

injectToStringAttributes

protected void injectToStringAttributes(StringBuilder sb)
Overrides:
injectToStringAttributes in class DefaultThreadPool


Copyright © 2009 SUN Microsystems. All Rights Reserved.