Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.turbine.pipeline
Interface Pipeline

All Known Implementing Classes:
  TurbinePipeline

    public interface Pipeline

The idea of a pipeline is being taken from Catalina in its entirety :-) I would like to take the idea further and implement Valves instead of hardcoding particular methods in a pipeline. It would be more flexible to specify Valves for a pipeline in an XML file (we can also rip off the digester rules from T4) and have invoke() as part of the interface. So a set of Valves would be added to the pipeline and the pipeline would 'invoke' each valve. In the case Turbine each Valve would produce some output to be sent out the pipe. I think with another days work this can be fully working. The first pipeline to be fully implemented will the ClassicPipeline will emulate the Turbine 2.1 way of doing things.

Author:
  Jason van Zyl, Daniel Rall, Peter Courcoux

Method Summary
`void` | `addValve(Valve valve)` Add a new Valve to the end of the pipeline.
`Valve[]` | `getValves()` Return the set of all Valves in the pipeline.
`void` | `initialize()` Initializes this instance.
`void` | `invoke(PipelineData data)` Cause the specified request and response to be processed by the sequence of Valves associated with this pipeline, until one of these Valves decides to end the processing.
`void` | `removeValve(Valve valve)` Remove the specified Valve from the pipeline, if it is found; otherwise, do nothing.

Method Detail

### initialize

    void initialize()
                    throws Exception

  Initializes this instance. Called once by the Turbine servlet.

  Throws:
    `Exception`

### addValve

    void addValve(Valve valve)

  Add a new Valve to the end of the pipeline.

  Parameters:
    `valve` - Valve to be added.
  Throws:
    `IllegalStateException` - If the pipeline has not been initialized.

### getValves

    Valve[] getValves()

  Return the set of all Valves in the pipeline. If there are no such Valves, a zero-length array is returned.

  Returns:
    An array of valves.

### invoke

    void invoke(PipelineData data)
                throws TurbineException,
                       IOException

  Cause the specified request and response to be processed by the sequence of Valves associated with this pipeline, until one of these Valves decides to end the processing.

  The implementation must ensure that multiple simultaneous requests (on different threads) can be processed through the same Pipeline without interfering with each other's control flow.

  Parameters:
    `data` - The run-time information, including the servlet request and response we are processing.
  Throws:
    `IOException` - an input/output error occurred.
    `TurbineException`

### removeValve

    void removeValve(Valve valve)

  Remove the specified Valve from the pipeline, if it is found; otherwise, do nothing.

  Parameters:
    `valve` - Valve to be removed.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.