com.sun.grizzly.http
Class StatsThreadPool

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

public class StatsThreadPool
extends SyncThreadPool

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 com.sun.grizzly.util.SyncThreadPool
SyncThreadPool.SyncThreadWorker
 
Nested classes/interfaces inherited from class com.sun.grizzly.util.AbstractThreadPool
AbstractThreadPool.Worker
 
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.SyncThreadPool
activeThreadsCount, currentPoolSize, maxQueuedTasks, running, statelock, threadsCounter, workers
 
Fields inherited from class com.sun.grizzly.util.AbstractThreadPool
byteBufferType, corePoolSize, DEFAULT_IDLE_THREAD_KEEPALIVE_TIMEOUT, DEFAULT_MAX_TASKS_QUEUED, DEFAULT_MAX_THREAD_COUNT, DEFAULT_MIN_THREAD_COUNT, initialByteBufferSize, keepAliveTime, maxPoolSize, name, poison, priority, threadFactory
 
Constructor Summary
StatsThreadPool()
           
StatsThreadPool(int maxTasksCount)
           
StatsThreadPool(int corePoolSize, int maximumPoolSize, int maxTasksCount, long keepAliveTime, TimeUnit unit)
           
StatsThreadPool(String name, 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.SyncThreadPool
afterExecute, awaitTermination, beforeExecute, execute, getActiveCount, getCompletedTaskCount, getLargestPoolSize, getMaxQueuedTasksCount, getPoolSize, getQueue, getQueueSize, getTaskCount, isShutdown, isTerminated, nextThreadId, onWorkerExit, setMaxQueuedTasksCount, setPoolSizes, shutdown, shutdownNow, start, startWorker, stop
 
Methods inherited from class com.sun.grizzly.util.AbstractThreadPool
getByteBufferType, getCorePoolSize, getInitialByteBufferSize, getKeepAliveTime, getMaximumPoolSize, getName, getPriority, getThreadFactory, onMaxNumberOfThreadsReached, onTaskDequeued, onTaskQueued, onTaskQueueOverflow, onWorkerStarted, setByteBufferType, setCorePoolSize, setInitialByteBufferSize, setKeepAliveTime, setMaximumPoolSize, setName, setPriority, setThreadFactory, uncaughtException, validateNewPoolSize
 
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.ExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
 

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)

StatsThreadPool

public StatsThreadPool(String name,
                       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 SyncThreadPool

injectToStringAttributes

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


Copyright © 2009 SUN Microsystems. All Rights Reserved.