001:
002: /*
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
004: *
005: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
006: *
007: * Portions Copyright Apache Software Foundation.
008: *
009: * The contents of this file are subject to the terms of either the GNU
010: * General Public License Version 2 only ("GPL") or the Common Development
011: * and Distribution License("CDDL") (collectively, the "License"). You
012: * may not use this file except in compliance with the License. You can obtain
013: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
014: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
015: * language governing permissions and limitations under the License.
016: *
017: * When distributing the software, include this License Header Notice in each
018: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
019: * Sun designates this particular file as subject to the "Classpath" exception
020: * as provided by Sun in the GPL Version 2 section of the License file that
021: * accompanied this code. If applicable, add the following below the License
022: * Header, with the fields enclosed by brackets [] replaced by your own
023: * identifying information: "Portions Copyrighted [year]
024: * [name of copyright owner]"
025: *
026: * Contributor(s):
027: *
028: * If you wish your version of this file to be governed by only the CDDL or
029: * only the GPL Version 2, indicate your decision by adding "[Contributor]
030: * elects to include this software in this distribution under the [CDDL or GPL
031: * Version 2] license." If you don't indicate a single choice of license, a
032: * recipient has the option to distribute your version of this file under
033: * either the CDDL, the GPL Version 2 or to extend the choice of license to
034: * its licensees as provided above. However, if you add GPL Version 2 code
035: * and therefore, elected the GPL Version 2 license, then the option applies
036: * only if the new code is made subject to such option by the copyright
037: * holder.
038: */
039:
040: package javax.servlet;
041:
042: import java.util.Enumeration;
043:
044: /**
045: *
046: * A servlet configuration object used by a servlet container
047: * to pass information to a servlet during initialization.
048: *
049: */
050:
051: public interface ServletConfig {
052:
053: /**
054: * Returns the name of this servlet instance.
055: * The name may be provided via server administration, assigned in the
056: * web application deployment descriptor, or for an unregistered (and thus
057: * unnamed) servlet instance it will be the servlet's class name.
058: *
059: * @return the name of the servlet instance
060: *
061: *
062: *
063: */
064:
065: public String getServletName();
066:
067: /**
068: * Returns a reference to the {@link ServletContext} in which the caller
069: * is executing.
070: *
071: *
072: * @return a {@link ServletContext} object, used
073: * by the caller to interact with its servlet
074: * container
075: *
076: * @see ServletContext
077: *
078: */
079:
080: public ServletContext getServletContext();
081:
082: /**
083: * Returns a <code>String</code> containing the value of the
084: * named initialization parameter, or <code>null</code> if
085: * the parameter does not exist.
086: *
087: * @param name a <code>String</code> specifying the name
088: * of the initialization parameter
089: *
090: * @return a <code>String</code> containing the value
091: * of the initialization parameter
092: *
093: */
094:
095: public String getInitParameter(String name);
096:
097: /**
098: * Returns the names of the servlet's initialization parameters
099: * as an <code>Enumeration</code> of <code>String</code> objects,
100: * or an empty <code>Enumeration</code> if the servlet has
101: * no initialization parameters.
102: *
103: * @return an <code>Enumeration</code> of <code>String</code>
104: * objects containing the names of the servlet's
105: * initialization parameters
106: *
107: *
108: *
109: */
110:
111: public Enumeration getInitParameterNames();
112:
113: }
|