|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Pipeline<T extends PipelineComponent>
A pipeline expects one or more PipelineComponent
s that passed by
using addComponent(PipelineComponent)
. Then these components get
linked with each other in the order they were added. The
setup(OutputStream, Map)
method, calls the setup method on all
pipeline components and assembles the pipeline. Finally the
execute()
method produces the result and writes it to the
OutputStream
which has been passed to the
setup(OutputStream, Map)
method.
A pipeline works based on two fundamental concepts:
Starter
. The last
component is of type Finisher
. Producer
, the latter Consumer
.
When the pipeline links the components, it merely checks whether the above
mentioned interfaces are present. So the pipeline does not know about the
specific capabilities or the compatibility of the components. It is the
responsibility of the Producer
to decide whether a specific
Consumer
can be linked to it or not (that is, whether it can produce
output in the desired format of the Consumer
or not). It is also
conceivable that a Producer
is capable of accepting different types
of Consumer
s and adjust the output format according to the actual
Consumer
.
Method Summary | |
---|---|
void |
addComponent(T pipelineComponent)
Add a PipelineComponent to the pipeline. |
void |
execute()
After the pipeline has been setup ( setup(OutputStream, Map) ,
this method can be invoked in order to produce the result. |
String |
getContentType()
Get the mime-type of the content produced by the pipeline. |
long |
getLastModified()
Get the time of the last modification. |
void |
setConfiguration(Map<String,? extends Object> parameters)
Pass pipeline specific configuration parameters to the pipeline component in a generic way. |
void |
setup(OutputStream outputStream)
After the pipeline has been prepared ( addComponent(PipelineComponent) ,
this method can be invoked in order to setup and initialize the pipeline
and its components. |
void |
setup(OutputStream outputStream,
Map<String,Object> parameters)
The same as setup(OutputStream) but also allows passing
parameters to the pipeline components. |
Method Detail |
---|
void addComponent(T pipelineComponent)
PipelineComponent
to the pipeline. The order of when the
components are passed is significant.
pipelineComponent
- The PipelineComponent
.void execute() throws Exception
setup(OutputStream, Map)
,
this method can be invoked in order to produce the result.
Exception
- Any problem that might occur while processing the
pipeline.String getContentType()
long getLastModified()
void setup(OutputStream outputStream)
addComponent(PipelineComponent)
,
this method can be invoked in order to setup and initialize the pipeline
and its components.
outputStream
- An OutputStream
where the pipeline execution
result is written.void setup(OutputStream outputStream, Map<String,Object> parameters)
setup(OutputStream)
but also allows passing
parameters to the pipeline components.
outputStream
- An OutputStream
where the pipeline execution
result is written.parameters
- A Map
of parameters that are available to all
PipelineComponent
s.void setConfiguration(Map<String,? extends Object> parameters)
configuration
- The Map
of configuration parameters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |