com.sun.enterprise.web.connector.grizzly
Interface Pipeline

All Known Implementing Classes:
IsolationPipeline, LinkedListPipeline, PortUnificationPipeline, SSLPipeline, ThreadPoolExecutorPipeline

public interface Pipeline

An interface used as a wrapper around any kind of thread pool

Author:
Jean-Francois Arcand

Method Summary
 void addTask(Task task)
          Add an Task to be processed by 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 number of maximum spare thread.
 int getMaxThreads()
          Return the number of threads used by this pipeline.
 int getMinSpareThreads()
          Return the number of minimum spare thread.
 String getName()
          Return the name of this Pipeline
 PipelineStatistic getPipelineStatistic()
          Return the PipelineStatistic object used to gather statistic;
 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 WorkerThread.
 boolean interruptThread(long threadId)
          Interrup the Thread using it thread id
 void setMaxThreads(int maxThread)
          Set the maximum thread this pipeline can handle.
 void setMinSpareThreads(int minSpareThreads)
          Set the number of minimum spare thread.
 void setMinThreads(int minThread)
          Set the minimum thread this pipeline can handle.
 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 this Pipeline is associated with.
 void setPriority(int priority)
          Set the Thread priority used when creating new threads.
 void setQueueSizeInBytes(int maxQueueSizeInBytesCount)
          Set the maximum pending connection this Pipeline can handle.
 void setThreadsIncrement(int processorThreadsIncrement)
          Set the number the Pipeline will use when increasing the thread pool
 void setThreadsTimeout(int processorThreadsTimeout)
          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
 

Method Detail

expireKey

boolean expireKey(SelectionKey key)
Invoked when the SelectorThread is about to expire a SelectionKey.

Returns:
true if the SelectorThread should expire the SelectionKey, false if not.

addTask

void addTask(Task task)
Add an Task to be processed by this Pipeline


getTask

Task getTask()
Return a Task object available in the pipeline.


getWaitingThread

int getWaitingThread()
Return the number of waiting threads.


getMaxThreads

int getMaxThreads()
Return the number of threads used by this pipeline.


getCurrentThreadCount

int getCurrentThreadCount()
Return the number of active threads.


getCurrentThreadsBusy

int getCurrentThreadsBusy()
Return the curent number of threads that are currently processing a task.


initPipeline

void initPipeline()
Init the Pipeline by initializing the required WorkerThread. Default value is 10


getName

String getName()
Return the name of this Pipeline


startPipeline

void startPipeline()
Start the Pipeline


stopPipeline

void stopPipeline()
Stop the Pipeline


setPriority

void setPriority(int priority)
Set the Thread priority used when creating new threads.


setMaxThreads

void setMaxThreads(int maxThread)
Set the maximum thread this pipeline can handle.


setMinThreads

void setMinThreads(int minThread)
Set the minimum thread this pipeline can handle.


setPort

void setPort(int port)
Set the port this Pipeline is associated with.


setName

void setName(String name)
Set the name of this Pipeline


setQueueSizeInBytes

void setQueueSizeInBytes(int maxQueueSizeInBytesCount)
Set the maximum pending connection this Pipeline can handle.


setThreadsIncrement

void setThreadsIncrement(int processorThreadsIncrement)
Set the number the Pipeline will use when increasing the thread pool


setThreadsTimeout

void setThreadsTimeout(int processorThreadsTimeout)
Set the timeout value a thread will use to times out the request.


setPipelineStatistic

void setPipelineStatistic(PipelineStatistic pipelineStatistic)
Set the PipelineStatistic object used to gather statistic;


getPipelineStatistic

PipelineStatistic getPipelineStatistic()
Return the PipelineStatistic object used to gather statistic;


size

int size()
Returns the number of tasks in this Pipeline.

Returns:
Number of tasks in this Pipeline.

getMaxSpareThreads

int getMaxSpareThreads()
Return the number of maximum spare thread.


getMinSpareThreads

int getMinSpareThreads()
Return the number of minimum spare thread.


setMinSpareThreads

void setMinSpareThreads(int minSpareThreads)
Set the number of minimum spare thread.


interruptThread

boolean interruptThread(long threadId)
Interrup the Thread using it thread id



Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.