|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<Task>
com.sun.enterprise.web.connector.grizzly.LinkedListPipeline
public class LinkedListPipeline
Internal FIFO used by the Worker Threads to pass information
between Task objects.
| Field Summary | |
|---|---|
protected boolean |
isStarted
Has the pipeline already started |
protected int |
maxQueueSizeInBytes
Maximum pending connection before refusing requests. |
protected int |
maxThreads
The maximum number of Thread |
protected int |
minSpareThreads
The minimum numbers of spare WorkerThreadImpl |
protected int |
minThreads
The minimum numbers of WorkerThreadImpl |
protected String |
name
The name of this Pipeline |
protected PipelineStatistic |
pipelineStat
The PipelineStatistic objects used when gathering statistics. |
protected int |
port
The port used. |
protected int |
priority
The Thread Priority |
protected int |
threadCount
The number of WorkerThreadImpl |
protected int |
threadsIncrement
The increment number used when adding new thread. |
protected int |
threadsTimeout
The request times out during transaction. |
protected int |
waitingThreads
The number of thread waiting for a Task |
protected WorkerThreadImpl[] |
workerThreads
WorkerThreadImpl amanged by this pipeline. |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
LinkedListPipeline()
|
|
LinkedListPipeline(int maxThreads,
int minThreads,
String name,
int port)
|
|
LinkedListPipeline(int maxThreads,
int minThreads,
String name,
int port,
int priority)
|
|
| 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 number of active threads. |
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 |
getTaskQueuedCount()
The number of Task currently queued |
int |
getWaitingThread()
Return the number of waiting threads. |
protected void |
increaseWorkerThread(int increment,
boolean startThread)
Create new WorkerThreadImpl. |
void |
initPipeline()
Init the Pipeline by initializing the required
WorkerThreadImpl. |
boolean |
interruptThread(long threadID)
Interrupt the Thread using it thread id |
boolean |
isEmpty()
Return true if the size of this ArrayList
minus the current waiting threads is lower than zero. |
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 maxQueueSizeInBytesCount)
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. |
void |
startPipeline()
Start the Pipeline and all associated
WorkerThreadImpl |
void |
stopPipeline()
Stop the Pipeline and all associated
WorkerThreadImpl |
String |
toString()
|
| Methods inherited from class java.util.LinkedList |
|---|
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray |
| Methods inherited from class java.util.AbstractSequentialList |
|---|
iterator |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sun.enterprise.web.connector.grizzly.Pipeline |
|---|
size |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, removeAll, retainAll, subList |
| Methods inherited from interface java.util.Deque |
|---|
iterator |
| Field Detail |
|---|
protected int waitingThreads
Task
protected int maxThreads
protected int minThreads
WorkerThreadImpl
protected int minSpareThreads
WorkerThreadImpl
protected int port
protected int threadCount
WorkerThreadImpl
protected String name
protected int priority
protected boolean isStarted
protected transient WorkerThreadImpl[] workerThreads
WorkerThreadImpl amanged by this pipeline.
protected int maxQueueSizeInBytes
protected int threadsIncrement
protected int threadsTimeout
protected transient PipelineStatistic pipelineStat
PipelineStatistic objects used when gathering statistics.
| Constructor Detail |
|---|
public LinkedListPipeline()
public LinkedListPipeline(int maxThreads,
int minThreads,
String name,
int port,
int priority)
public LinkedListPipeline(int maxThreads,
int minThreads,
String name,
int port)
| Method Detail |
|---|
public void initPipeline()
Pipeline by initializing the required
WorkerThreadImpl. Default value is 10
initPipeline in interface Pipelinepublic void startPipeline()
Pipeline and all associated
WorkerThreadImpl
startPipeline in interface Pipelinepublic void stopPipeline()
Pipeline and all associated
WorkerThreadImpl
stopPipeline in interface Pipeline
protected void increaseWorkerThread(int increment,
boolean startThread)
WorkerThreadImpl. This method must be invoked
from a synchronized block.
public boolean interruptThread(long threadID)
Thread using it thread id
interruptThread in interface Pipelinepublic void addTask(Task task)
addTask in interface Pipelinepublic Task getTask()
Task object available in the pipeline.
All Threads will synchronize on that method
getTask in interface Pipelinepublic boolean expireKey(SelectionKey key)
expireKey in interface Pipelinepublic boolean isEmpty()
true if the size of this ArrayList
minus the current waiting threads is lower than zero.
isEmpty in interface Collection<Task>isEmpty in interface List<Task>isEmpty in class AbstractCollection<Task>public int getWaitingThread()
getWaitingThread in interface Pipelinepublic void setMaxThreads(int maxThreads)
setMaxThreads in interface Pipelinepublic int getMaxThreads()
getMaxThreads in interface Pipelinepublic int getCurrentThreadCount()
Pipeline
getCurrentThreadCount in interface Pipelinepublic int getCurrentThreadsBusy()
getCurrentThreadsBusy in interface Pipelinepublic int getMaxSpareThreads()
getMaxSpareThreads in interface Pipelinepublic int getMinSpareThreads()
getMinSpareThreads in interface Pipelinepublic void setMinSpareThreads(int minSpareThreads)
Pipeline can handle.
setMinSpareThreads 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 String toString()
toString in class AbstractCollection<Task>public void setThreadsIncrement(int threadsIncrement)
Pipeline will use when increasing the
thread pool
setThreadsIncrement in interface Pipelinepublic void setThreadsTimeout(int threadsTimeout)
setThreadsTimeout in interface Pipelinepublic int getTaskQueuedCount()
Task currently queued
public void setQueueSizeInBytes(int maxQueueSizeInBytesCount)
Pipeline
can handle.
setQueueSizeInBytes in interface Pipelinepublic int getQueueSizeInBytes()
Pipeline
can handle.
public 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 | |||||||||