View Javadoc

1   /*
2   * Copyright 2004 The Apache Software Foundation
3   *
4   * Licensed under the Apache License, Version 2.0 (the "License");
5   * you may not use this file except in compliance with the License.
6   * You may obtain a copy of the License at
7   *
8   *     http://www.apache.org/licenses/LICENSE-2.0
9   *
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  package javax.servlet;
17  
18  import java.util.Enumeration;
19  
20  
21  
22  /**
23   * 
24   * A servlet configuration object used by a servlet container
25   * to pass information to a servlet during initialization. 
26   *
27   */
28   
29  public interface ServletConfig {
30      
31  
32      /**
33       * Returns the name of this servlet instance.
34       * The name may be provided via server administration, assigned in the 
35       * web application deployment descriptor, or for an unregistered (and thus
36       * unnamed) servlet instance it will be the servlet's class name.
37       *
38       * @return		the name of the servlet instance
39       *
40       *
41       *
42       */
43  
44      public String getServletName();
45  
46      /**
47       * Returns a reference to the {@link ServletContext} in which the caller
48       * is executing.
49       *
50       *
51       * @return		a {@link ServletContext} object, used
52       *			by the caller to interact with its servlet 
53       *                  container
54       * 
55       * @see		ServletContext
56       *
57       */
58  
59      public ServletContext getServletContext();
60      
61      /**
62       * Returns a <code>String</code> containing the value of the 
63       * named initialization parameter, or <code>null</code> if 
64       * the parameter does not exist.
65       *
66       * @param name	a <code>String</code> specifying the name
67       *			of the initialization parameter
68       *
69       * @return		a <code>String</code> containing the value 
70       *			of the initialization parameter
71       *
72       */
73  
74      public String getInitParameter(String name);
75  
76  
77      /**
78       * Returns the names of the servlet's initialization parameters
79       * as an <code>Enumeration</code> of <code>String</code> objects, 
80       * or an empty <code>Enumeration</code> if the servlet has
81       * no initialization parameters.
82       *
83       * @return		an <code>Enumeration</code> of <code>String</code> 
84       *			objects containing the names of the servlet's 
85       *			initialization parameters
86       *
87       *
88       *
89       */
90  
91      public Enumeration getInitParameterNames();
92  
93  
94  }