001package org.apache.turbine.pipeline; 002 003 004/* 005 * Licensed to the Apache Software Foundation (ASF) under one 006 * or more contributor license agreements. See the NOTICE file 007 * distributed with this work for additional information 008 * regarding copyright ownership. The ASF licenses this file 009 * to you under the Apache License, Version 2.0 (the 010 * "License"); you may not use this file except in compliance 011 * with the License. You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, 016 * software distributed under the License is distributed on an 017 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 018 * KIND, either express or implied. See the License for the 019 * specific language governing permissions and limitations 020 * under the License. 021 */ 022 023 024import java.io.IOException; 025 026import org.apache.turbine.util.TurbineException; 027 028/** 029 * <p>A <b>ValveContext</b> is the mechanism by which a Valve can trigger the 030 * execution of the next Valve in a Pipeline, without having to know anything 031 * about the internal implementation mechanisms. An instance of a class 032 * implementing this interface is passed as a parameter to the 033 * <code>Valve.invoke()</code> method of each executed Valve.</p> 034 * 035 * <p><strong>IMPLEMENTATION NOTE</strong>: It is up to the implementation of 036 * ValveContext to ensure that simultaneous requests being processed (by 037 * separate threads) through the same Pipeline do not interfere with each 038 * other's flow of control.</p> 039 * 040 * @author Craig R. McClanahan 041 * @author Gunnar Rjnning 042 * @author Peter Donald 043 * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a> 044 * @version $Revision$ $Date$ 045 */ 046@FunctionalInterface 047public interface ValveContext 048{ 049 /** 050 * <p>Cause the <code>invoke()</code> method of the next Valve 051 * that is part of the Pipeline currently being processed (if any) 052 * to be executed, passing on the specified request and response 053 * objects plus this <code>ValveContext</code> instance. 054 * Exceptions thrown by a subsequently executed Valve will be 055 * passed on to our caller.</p> 056 * 057 * <p>If there are no more Valves to be executed, execution of 058 * this method will result in a no op.</p> 059 * 060 * @param pipelineData The run-time information, including the servlet 061 * request and response we are processing. 062 * 063 * @throws IOException Thrown by a subsequent Valve. 064 * @throws TurbineException Thrown by a subsequent Valve. 065 * @throws TurbineException No further Valves configured in the 066 * Pipeline currently being processed. 067 */ 068 void invokeNext(PipelineData pipelineData) 069 throws IOException, TurbineException; 070}