01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package javax.servlet;
18:
19: import java.util.Enumeration;
20:
21: /**
22: *
23: * A servlet configuration object used by a servlet container
24: * to pass information to a servlet during initialization.
25: *
26: */
27:
28: public interface ServletConfig {
29:
30: /**
31: * Returns the name of this servlet instance.
32: * The name may be provided via server administration, assigned in the
33: * web application deployment descriptor, or for an unregistered (and thus
34: * unnamed) servlet instance it will be the servlet's class name.
35: *
36: * @return the name of the servlet instance
37: *
38: *
39: *
40: */
41:
42: public String getServletName();
43:
44: /**
45: * Returns a reference to the {@link ServletContext} in which the caller
46: * is executing.
47: *
48: *
49: * @return a {@link ServletContext} object, used
50: * by the caller to interact with its servlet
51: * container
52: *
53: * @see ServletContext
54: *
55: */
56:
57: public ServletContext getServletContext();
58:
59: /**
60: * Returns a <code>String</code> containing the value of the
61: * named initialization parameter, or <code>null</code> if
62: * the parameter does not exist.
63: *
64: * @param name a <code>String</code> specifying the name
65: * of the initialization parameter
66: *
67: * @return a <code>String</code> containing the value
68: * of the initialization parameter
69: *
70: */
71:
72: public String getInitParameter(String name);
73:
74: /**
75: * Returns the names of the servlet's initialization parameters
76: * as an <code>Enumeration</code> of <code>String</code> objects,
77: * or an empty <code>Enumeration</code> if the servlet has
78: * no initialization parameters.
79: *
80: * @return an <code>Enumeration</code> of <code>String</code>
81: * objects containing the names of the servlet's
82: * initialization parameters
83: *
84: *
85: *
86: */
87:
88: public Enumeration getInitParameterNames();
89:
90: }
|