View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.context.portlet;
20  
21  import java.util.Enumeration;
22  import java.util.Map;
23  
24  import javax.portlet.PortletContext;
25  
26  import org.apache.myfaces.util.AbstractThreadSafeAttributeMap;
27  
28  
29  /**
30   * PortletContext attributes as a Map.
31   *
32   * @author  Stan Silvert (latest modification by $Author: lu4242 $)
33   * @version $Revision: 1000660 $ $Date: 2010-09-23 18:02:43 -0500 (Thu, 23 Sep 2010) $
34   */
35  public class ApplicationMap extends AbstractThreadSafeAttributeMap
36  {
37      final PortletContext _portletContext;
38  
39      ApplicationMap(PortletContext portletContext)
40      {
41          _portletContext = portletContext;
42      }
43  
44      protected Object getAttribute(String key)
45      {
46          return _portletContext.getAttribute(key);
47      }
48  
49      protected void setAttribute(String key, Object value)
50      {
51          _portletContext.setAttribute(key, value);
52      }
53  
54      protected void removeAttribute(String key)
55      {
56          _portletContext.removeAttribute(key);
57      }
58  
59      protected Enumeration getAttributeNames()
60      {
61          return _portletContext.getAttributeNames();
62      }
63  
64      public void putAll(Map t)
65      {
66          throw new UnsupportedOperationException();
67      }
68  
69  
70      public void clear()
71      {
72          throw new UnsupportedOperationException();
73      }    
74  }