01: /*
02: * Copyright 1999-2001,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.catalina;
18:
19: import java.io.IOException;
20: import javax.servlet.ServletException;
21:
22: /**
23: * <p>A <b>ValveContext</b> is the mechanism by which a Valve can trigger the
24: * execution of the next Valve in a Pipeline, without having to know anything
25: * about the internal implementation mechanisms. An instance of a class
26: * implementing this interface is passed as a parameter to the
27: * <code>Valve.invoke()</code> method of each executed Valve.</p>
28: *
29: * <p><strong>IMPLEMENTATION NOTE</strong>: It is up to the implementation of
30: * ValveContext to ensure that simultaneous requests being processed (by
31: * separate threads) through the same Pipeline do not interfere with each
32: * other's flow of control.</p>
33: *
34: * @author Craig R. McClanahan
35: * @author Gunnar Rjnning
36: * @author Peter Donald
37: * @version $Revision: 1.2 $ $Date: 2004/02/27 14:58:39 $
38: */
39:
40: public interface ValveContext {
41:
42: //-------------------------------------------------------------- Properties
43:
44: /**
45: * Return descriptive information about this ValveContext implementation.
46: */
47: public String getInfo();
48:
49: //---------------------------------------------------------- Public Methods
50:
51: /**
52: * Cause the <code>invoke()</code> method of the next Valve that is part of
53: * the Pipeline currently being processed (if any) to be executed, passing
54: * on the specified request and response objects plus this
55: * <code>ValveContext</code> instance. Exceptions thrown by a subsequently
56: * executed Valve (or a Filter or Servlet at the application level) will be
57: * passed on to our caller.
58: *
59: * If there are no more Valves to be executed, an appropriate
60: * ServletException will be thrown by this ValveContext.
61: *
62: * @param request The request currently being processed
63: * @param response The response currently being created
64: *
65: * @exception IOException if thrown by a subsequent Valve, Filter, or
66: * Servlet
67: * @exception ServletException if thrown by a subsequent Valve, Filter,
68: * or Servlet
69: * @exception ServletException if there are no further Valves configured
70: * in the Pipeline currently being processed
71: */
72: public void invokeNext(Request request, Response response)
73: throws IOException, ServletException;
74:
75: }
|