01: /*
02: * Copyright 1999,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.apache.catalina.core;
18:
19: import java.util.Enumeration;
20:
21: import javax.servlet.ServletConfig;
22: import javax.servlet.ServletContext;
23:
24: /**
25: * Facade for the <b>StandardWrapper</b> object.
26: *
27: * @author Remy Maucharat
28: * @version $Revision: 1.3 $ $Date: 2004/02/27 14:58:42 $
29: */
30:
31: public final class StandardWrapperFacade implements ServletConfig {
32:
33: // ----------------------------------------------------------- Constructors
34:
35: /**
36: * Create a new facede around a StandardWrapper.
37: */
38: public StandardWrapperFacade(StandardWrapper config) {
39:
40: super ();
41: this .config = (ServletConfig) config;
42:
43: }
44:
45: // ----------------------------------------------------- Instance Variables
46:
47: /**
48: * Wrapped config.
49: */
50: private ServletConfig config = null;
51:
52: // -------------------------------------------------- ServletConfig Methods
53:
54: public String getServletName() {
55: return config.getServletName();
56: }
57:
58: public ServletContext getServletContext() {
59: ServletContext theContext = config.getServletContext();
60: if ((theContext != null)
61: && (theContext instanceof ApplicationContext))
62: theContext = ((ApplicationContext) theContext).getFacade();
63: return (theContext);
64: }
65:
66: public String getInitParameter(String name) {
67: return config.getInitParameter(name);
68: }
69:
70: public Enumeration getInitParameterNames() {
71: return config.getInitParameterNames();
72: }
73:
74: }
|