1 2 3 /* 4 * The contents of this file are subject to the terms 5 * of the Common Development and Distribution License 6 * (the "License"). You may not use this file except 7 * in compliance with the License. 8 * 9 * You can obtain a copy of the license at 10 * glassfish/bootstrap/legal/CDDLv1.0.txt or 11 * https://glassfish.dev.java.net/public/CDDLv1.0.html. 12 * See the License for the specific language governing 13 * permissions and limitations under the License. 14 * 15 * When distributing Covered Code, include this CDDL 16 * HEADER in each file and include the License file at 17 * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 18 * add the following below this CDDL HEADER, with the 19 * fields enclosed by brackets "[]" replaced with your 20 * own identifying information: Portions Copyright [yyyy] 21 * [name of copyright owner] 22 * 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24 * 25 * Portions Copyright Apache Software Foundation. 26 */ 27 28 29 package org.apache.catalina; 30 31 32 import java.io.IOException; 33 import javax.servlet.ServletException; 34 35 36 /** 37 * <p>A <b>ValveContext</b> is the mechanism by which a Valve can trigger the 38 * execution of the next Valve in a Pipeline, without having to know anything 39 * about the internal implementation mechanisms. An instance of a class 40 * implementing this interface is passed as a parameter to the 41 * <code>Valve.invoke()</code> method of each executed Valve.</p> 42 * 43 * <p><strong>IMPLEMENTATION NOTE</strong>: It is up to the implementation of 44 * ValveContext to ensure that simultaneous requests being processed (by 45 * separate threads) through the same Pipeline do not interfere with each 46 * other's flow of control.</p> 47 * 48 * @author Craig R. McClanahan 49 * @author Gunnar Rjnning 50 * @author Peter Donald 51 * @version $Revision: 1.2 $ $Date: 2005/12/08 01:27:22 $ 52 */ 53 54 public interface ValveContext { 55 56 57 //-------------------------------------------------------------- Properties 58 59 60 /** 61 * Return descriptive information about this ValveContext implementation. 62 */ 63 public String getInfo(); 64 65 66 //---------------------------------------------------------- Public Methods 67 68 69 /** 70 * Cause the <code>invoke()</code> method of the next Valve that is part of 71 * the Pipeline currently being processed (if any) to be executed, passing 72 * on the specified request and response objects plus this 73 * <code>ValveContext</code> instance. Exceptions thrown by a subsequently 74 * executed Valve (or a Filter or Servlet at the application level) will be 75 * passed on to our caller. 76 * 77 * If there are no more Valves to be executed, an appropriate 78 * ServletException will be thrown by this ValveContext. 79 * 80 * @param request The request currently being processed 81 * @param response The response currently being created 82 * 83 * @exception IOException if thrown by a subsequent Valve, Filter, or 84 * Servlet 85 * @exception ServletException if thrown by a subsequent Valve, Filter, 86 * or Servlet 87 * @exception ServletException if there are no further Valves configured 88 * in the Pipeline currently being processed 89 */ 90 public void invokeNext(Request request, Response response) 91 throws IOException, ServletException; 92 93 94 } 95