|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.web.connector.grizzly.ThreadPoolExecutorPipeline
public class ThreadPoolExecutorPipeline
A wrapper around an ThreadPoolExecutor. This thread pool
is bounded by an ArrayBlockingQueue
| Field Summary | |
|---|---|
protected PipelineStatistic |
pipelineStat
The PipelineStatistic objects used when gathering statistics. |
| Constructor Summary | |
|---|---|
ThreadPoolExecutorPipeline()
|
|
| Method Summary | |
|---|---|
void |
addTask(Task task)
Add an object to this pipeline |
boolean |
expireKey(SelectionKey key)
Invoked when the SelectorThread is about to expire a SelectionKey. |
int |
getCurrentThreadCount()
Return the current number of threads used. |
int |
getCurrentThreadsBusy()
Return the curent number of threads that are currently processing a task. |
int |
getMaxSpareThreads()
Return the maximum spare thread. |
int |
getMaxThreads()
Return the number of threads used by this pipeline. |
int |
getMinSpareThreads()
Return the minimum spare thread. |
String |
getName()
Return the name of this Pipeline |
PipelineStatistic |
getPipelineStatistic()
Return the PipelineStatistic object used
to gather statistic; |
int |
getQueueSizeInBytes()
Get the maximum pending connection this Pipeline
can handle. |
Task |
getTask()
Return a Task object available in the pipeline. |
int |
getWaitingThread()
Return the number of waiting threads. |
void |
initPipeline()
Init the Pipeline by initializing the required
ThreadPoolExecutor. |
boolean |
interruptThread(long threadID)
Interrupt the Thread using it thread id |
void |
rejectedExecution(Runnable r,
ThreadPoolExecutor executor)
When the maxQueueSizeInBytesConnection is reached,
terminate Task |
void |
setMaxThreads(int maxThreads)
Set the number of threads used by this pipeline. |
void |
setMinSpareThreads(int minSpareThreads)
Set the minimum space thread this Pipeline can handle. |
void |
setMinThreads(int minThreads)
Set the minimum thread this Pipeline will creates
when initializing. |
void |
setName(String name)
Set the name of this Pipeline |
void |
setPipelineStatistic(PipelineStatistic pipelineStatistic)
Set the PipelineStatistic object used
to gather statistic; |
void |
setPort(int port)
Set the port used by this Pipeline |
void |
setPriority(int priority)
Set the thread priority of the Pipeline |
void |
setQueueSizeInBytes(int maxQueueSizeInBytes)
Set the maximum pending connection this Pipeline
can handle. |
void |
setThreadsIncrement(int threadsIncrement)
Set the number the Pipeline will use when increasing the
thread pool |
void |
setThreadsTimeout(int threadsTimeout)
Set the timeout value a thread will use to times out the request. |
int |
size()
Returns the number of tasks in this Pipeline. |
void |
startPipeline()
Start the Pipeline |
void |
stopPipeline()
Stop the Pipeline |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected PipelineStatistic pipelineStat
PipelineStatistic objects used when gathering statistics.
| Constructor Detail |
|---|
public ThreadPoolExecutorPipeline()
| Method Detail |
|---|
public void initPipeline()
Pipeline by initializing the required
ThreadPoolExecutor.
initPipeline in interface Pipelinepublic void startPipeline()
Pipeline
startPipeline in interface Pipelinepublic void stopPipeline()
Pipeline
stopPipeline in interface Pipelinepublic void addTask(Task task)
addTask in interface Pipelinepublic Task getTask()
Task object available in the pipeline.
getTask in interface Pipelinepublic boolean expireKey(SelectionKey key)
expireKey in interface Pipelinepublic int size()
Pipeline.
size in interface PipelinePipeline.public boolean interruptThread(long threadID)
Thread using it thread id
interruptThread in interface Pipelinepublic int getWaitingThread()
getWaitingThread in interface Pipelinepublic void setMaxThreads(int maxThreads)
setMaxThreads in interface Pipelinepublic int getMaxThreads()
getMaxThreads in interface Pipelinepublic int getCurrentThreadCount()
getCurrentThreadCount in interface Pipelinepublic int getCurrentThreadsBusy()
getCurrentThreadsBusy in interface Pipelinepublic int getMaxSpareThreads()
getMaxSpareThreads in interface Pipelinepublic void setPriority(int priority)
Pipeline
setPriority in interface Pipelinepublic void setName(String name)
Pipeline
setName in interface Pipelinepublic String getName()
Pipeline
getName in interface PipelinePipelinepublic void setPort(int port)
Pipeline
setPort in interface Pipelineport - the port used by this Pipelinepublic void setMinThreads(int minThreads)
Pipeline will creates
when initializing.
setMinThreads in interface PipelineminThreads - the minimum number of threads.public void setQueueSizeInBytes(int maxQueueSizeInBytes)
Pipeline
can handle.
setQueueSizeInBytes in interface Pipelinepublic int getQueueSizeInBytes()
Pipeline
can handle.
public String toString()
toString in class Object
public void rejectedExecution(Runnable r,
ThreadPoolExecutor executor)
maxQueueSizeInBytesConnection is reached,
terminate Task
rejectedExecution in interface RejectedExecutionHandlerpublic void setThreadsIncrement(int threadsIncrement)
PipelinePipeline will use when increasing the
thread pool
setThreadsIncrement in interface Pipelinepublic void setThreadsTimeout(int threadsTimeout)
Pipeline
setThreadsTimeout in interface Pipelinepublic int getMinSpareThreads()
getMinSpareThreads in interface Pipelinepublic void setMinSpareThreads(int minSpareThreads)
Pipeline can handle.
setMinSpareThreads in interface Pipelinepublic void setPipelineStatistic(PipelineStatistic pipelineStatistic)
PipelineStatistic object used
to gather statistic;
setPipelineStatistic in interface Pipelinepublic PipelineStatistic getPipelineStatistic()
PipelineStatistic object used
to gather statistic;
getPipelineStatistic in interface Pipeline
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||