/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.cocoon.pipeline; import java.io.OutputStream; import java.util.Map; import org.apache.cocoon.pipeline.component.Consumer; import org.apache.cocoon.pipeline.component.Finisher; import org.apache.cocoon.pipeline.component.PipelineComponent; import org.apache.cocoon.pipeline.component.Producer; import org.apache.cocoon.pipeline.component.Starter; /** *
* A pipeline expects one or more {@link PipelineComponent}s that passed by * using {@link #addComponent(PipelineComponent)}. Then these components get * linked with each other in the order they were added. The * {@link #setup(OutputStream, Map)} method, calls the setup method on all * pipeline components and assembles the pipeline. Finally the * {@link #execute()} method produces the result and writes it to the * {@link OutputStream} which has been passed to the * {@link #setup(OutputStream, Map)} method. *
* ** A pipeline works based on two fundamental concepts: * *
* 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 {@link Producer} to decide whether a specific * {@link Consumer} can be linked to it or not (that is, whether it can produce * output in the desired format of the {@link Consumer} or not). It is also * conceivable that a {@link Producer} is capable of accepting different types * of {@link Consumer}s and adjust the output format according to the actual * {@link Consumer}. *
*/ public interface Pipeline