View Javadoc

1   /*
2    * Copyright 2000-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
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  package org.apache.portals.bridges.struts;
17  
18  import java.util.Enumeration;
19  
20  import javax.servlet.ServletConfig;
21  import javax.servlet.ServletContext;
22  
23  
24  /***
25   * PortletServletConfigImpl
26   * 
27   * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
28   * @version $Id: PortletServletConfigImpl.java 187139 2004-07-30 00:16:41 +0200 (Fri, 30 Jul 2004) ate $
29   */
30  class PortletServletConfigImpl implements ServletConfig
31  {
32      private ServletConfig config;
33      private ServletContext context;
34      public PortletServletConfigImpl(ServletConfig config)
35      {
36          this.config = config;
37      }
38      public String getInitParameter(String arg0)
39      {
40          return config.getInitParameter(arg0);
41      }
42      public Enumeration getInitParameterNames()
43      {
44          return config.getInitParameterNames();
45      }
46      public synchronized ServletContext getServletContext()
47      {
48          if (context == null)
49              context = new PortletServletContextImpl(config.getServletContext());
50          return context;
51      }
52      public String getServletName()
53      {
54          return config.getServletName();
55      }
56      public String toString()
57      {
58          return config.toString();
59      }
60  }