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 package javax.servlet; 29 30 import java.util.Enumeration; 31 32 33 34 /** 35 * 36 * A servlet configuration object used by a servlet container 37 * to pass information to a servlet during initialization. 38 * 39 */ 40 41 public interface ServletConfig { 42 43 44 /** 45 * Returns the name of this servlet instance. 46 * The name may be provided via server administration, assigned in the 47 * web application deployment descriptor, or for an unregistered (and thus 48 * unnamed) servlet instance it will be the servlet's class name. 49 * 50 * @return the name of the servlet instance 51 * 52 * 53 * 54 */ 55 56 public String getServletName(); 57 58 /** 59 * Returns a reference to the {@link ServletContext} in which the caller 60 * is executing. 61 * 62 * 63 * @return a {@link ServletContext} object, used 64 * by the caller to interact with its servlet 65 * container 66 * 67 * @see ServletContext 68 * 69 */ 70 71 public ServletContext getServletContext(); 72 73 /** 74 * Returns a <code>String</code> containing the value of the 75 * named initialization parameter, or <code>null</code> if 76 * the parameter does not exist. 77 * 78 * @param name a <code>String</code> specifying the name 79 * of the initialization parameter 80 * 81 * @return a <code>String</code> containing the value 82 * of the initialization parameter 83 * 84 */ 85 86 public String getInitParameter(String name); 87 88 89 /** 90 * Returns the names of the servlet's initialization parameters 91 * as an <code>Enumeration</code> of <code>String</code> objects, 92 * or an empty <code>Enumeration</code> if the servlet has 93 * no initialization parameters. 94 * 95 * @return an <code>Enumeration</code> of <code>String</code> 96 * objects containing the names of the servlet's 97 * initialization parameters 98 * 99 * 100 * 101 */ 102 103 public Enumeration getInitParameterNames(); 104 105 106 }