KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > core > StandardWrapperFacade


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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
18
19 package org.apache.catalina.core;
20
21
22 import java.util.Enumeration JavaDoc;
23
24 import javax.servlet.ServletConfig JavaDoc;
25 import javax.servlet.ServletContext JavaDoc;
26
27
28 /**
29  * Facade for the <b>StandardWrapper</b> object.
30  *
31  * @author Remy Maucharat
32  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
33  */

34
35 public final class StandardWrapperFacade
36     implements ServletConfig JavaDoc {
37
38
39     // ----------------------------------------------------------- Constructors
40

41
42     /**
43      * Create a new facede around a StandardWrapper.
44      */

45     public StandardWrapperFacade(StandardWrapper config) {
46
47         super();
48         this.config = (ServletConfig JavaDoc) config;
49
50     }
51
52
53     // ----------------------------------------------------- Instance Variables
54

55
56     /**
57      * Wrapped config.
58      */

59     private ServletConfig JavaDoc config = null;
60
61
62     // -------------------------------------------------- ServletConfig Methods
63

64
65     public String JavaDoc getServletName() {
66         return config.getServletName();
67     }
68
69
70     public ServletContext JavaDoc getServletContext() {
71         ServletContext JavaDoc theContext = config.getServletContext();
72         if ((theContext != null) &&
73             (theContext instanceof ApplicationContext))
74             theContext = ((ApplicationContext) theContext).getFacade();
75         return (theContext);
76     }
77
78
79     public String JavaDoc getInitParameter(String JavaDoc name) {
80         return config.getInitParameter(name);
81     }
82
83
84     public Enumeration JavaDoc getInitParameterNames() {
85         return config.getInitParameterNames();
86     }
87
88
89 }
90
Popular Tags