## com.sun.grizzly
Interface Pipeline<E>

All Known Implementing Classes:
  DefaultPipeline, ExecutorServicePipeline

    public interface Pipeline<E>

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

Author:
  Jean-Francois Arcand

Method Summary
`void` `execute(E task)` Add an `E` to be processed by this `Pipeline`
`int` `getCurrentThreadCount()` Return the number of active threads.
`int` `getCurrentThreadsBusy()` Return the curent number of threads that are currently processing a task.
`int` `getMaxThreads()` Return the number of threads used by this pipeline.
`String` `getName()` Return the name of this `Pipeline`
`int` `getWaitingThread()` Return the number of waiting threads.
`void` `initPipeline()` Init the `Pipeline` by initializing the required `WorkerThread`.
`void` `setMaxQueueSize(int maxQueue)` Set the maximum pending connection this `Pipeline` can handle.
`void` `setMaxThreads(int maxThread)` Set the maximum thread this pipeline can handle.
`void` `setMinThreads(int minThread)` Set the minimum thread this pipeline can handle.
`void` `setName(String name)` Set the name of this `Pipeline`
`void` `setPriority(int priority)` Set the `Thread` priority used when creating new threads.
`void` `setThreadsIncrement(int threadIncrements)` Set the number the `Pipeline` will use when increasing the thread pool
`int` `size()` Returns the number of tasks in this `Pipeline`.
`void` `startPipeline()` Start the `Pipeline`
`void` `stopPipeline()` Stop the `Pipeline`
`E` `waitForIoTask()` Return a `E` object available in the pipeline.

Method Detail

### execute

    void execute(E task)
                 throws PipelineFullException

  Add an `E` to be processed by this `Pipeline`

  Parameters:
    `task` -
  Throws:
    `PipelineFullException`

### waitForIoTask

    E waitForIoTask()

  Return a `E` object available in the pipeline.

  Returns:

### getWaitingThread

    int getWaitingThread()

  Return the number of waiting threads.

  Returns:
    number of waiting threads

### getMaxThreads

    int getMaxThreads()

  Return the number of threads used by this pipeline.

  Returns:
    max number of threads

### getCurrentThreadCount

    int getCurrentThreadCount()

  Return the number of active threads.

  Returns:
    number of active threads

### getCurrentThreadsBusy

    int getCurrentThreadsBusy()

  Return the curent number of threads that are currently processing a task.

  Returns:
    number of currently processing threads

### initPipeline

    void initPipeline()

  Init the `Pipeline` by initializing the required `WorkerThread`. Default value is 10

### getName

    String getName()

  Return the name of this `Pipeline`

  Returns:
    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.

  Parameters:
    `priority` -

### setMaxThreads

    void setMaxThreads(int maxThread)

  Set the maximum thread this pipeline can handle.

  Parameters:
    `maxThread` -

### setMinThreads

    void setMinThreads(int minThread)

  Set the minimum thread this pipeline can handle.

  Parameters:
    `minThread` -

### setName

    void setName(String name)

  Set the name of this `Pipeline`

  Parameters:
    `name` -

### setMaxQueueSize

    void setMaxQueueSize(int maxQueue)

  Set the maximum pending connection this `Pipeline` can handle.

  Parameters:
    `maxQueueSizeInBytesCount` -

### setThreadsIncrement

    void setThreadsIncrement(int threadIncrements)

  Set the number the `Pipeline` will use when increasing the thread pool

  Parameters:
    `processorThreadsIncrement` -

### size

    int size()

  Returns the number of tasks in this `Pipeline`.

  Returns:
    Number of tasks in this `Pipeline`.

Copyright © 2008 SUN Microsystems. All Rights Reserved.