01: /*
02: * Copyright (c) 1998-2001 Caucho Technology -- all rights reserved
03: *
04: * This file is part of Resin(R) Open Source
05: *
06: * Each copy or derived work must preserve the copyright notice and this
07: * notice unmodified.
08: *
09: * Resin Open Source is free software; you can redistribute it and/or modify
10: * it under the terms of the GNU General Public License as published by
11: * the Free Software Foundation; either version 2 of the License, or
12: * (at your option) any later version.
13: *
14: * Resin Open Source is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17: * of NON-INFRINGEMENT. See the GNU General Public License for more
18: * details.
19: *
20: * You should have received a copy of the GNU General Public License
21: * along with Resin Open Source; if not, write to the
22: * Free SoftwareFoundation, Inc.
23: * 59 Temple Place, Suite 330
24: * Boston, MA 02111-1307 USA
25: *
26: * @author Scott Ferguson
27: *
28: * $Id: ServletConfig.java,v 1.2 2004/09/29 00:12:46 cvs Exp $
29: */
30:
31: package javax.servlet;
32:
33: import java.util.Enumeration;
34:
35: /**
36: * ServletConfig encapsulates servlet configuration and gives access to
37: * the application (servlet context) object.
38: *
39: * Servlet initialization parameters appear in the servlet configuration
40: * file. Each servlet class may have several different servlet instances,
41: * one for each servlet parameters:
42: *
43: * <pre><code>
44: * <servlet servlet-name='my1'
45: * servlet-class='test.MyServlet'>
46: * <init-param param1='my1-1'/>
47: * <init-param param2='my1-2'/>
48: * </servlet>
49: *
50: * <servlet servlet-name='my2'
51: * servlet-class='test.MyServlet'>
52: * <init-param param1='my2-1'/>
53: * <init-param param2='my2-2'/>
54: * </servlet>
55: * </code></pre>
56: */
57: public interface ServletConfig {
58: /**
59: * Returns the servlet name for this configuration. For example,
60: * 'myservlet' in the following configuration:
61: *
62: * <pre><code>
63: * <servlet servlet-name='myservlet'
64: * servlet-class='test.MyServlet'/>
65: * </code></pre>
66: */
67: public String getServletName();
68:
69: /**
70: * Returns an initialization parameter. Initialization parameters
71: * are defined in the servlet configuration (in resin.conf) as follows:
72: *
73: * <pre><code>
74: * <servlet servlet-name='myservlet'
75: * servlet-class='test.MyServlet'>
76: * <init-param param1='value1'/>
77: * <init-param param2='value2'/>
78: * </servlet>
79: * </code></pre>
80: *
81: * @param name of the parameter
82: * @return the init parameter value
83: */
84: public String getInitParameter(String name);
85:
86: /**
87: * Returns an enumeration of the init-parameter names
88: */
89: public Enumeration getInitParameterNames();
90:
91: /**
92: * Returns the ServletContext for the servlet or filter.
93: */
94: public ServletContext getServletContext();
95: }
|