KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > context > portlet > RequestHeaderMap


1 /*
2  * Copyright 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.myfaces.context.portlet;
17
18 import java.util.Enumeration JavaDoc;
19 import javax.portlet.PortletRequest;
20 import org.apache.myfaces.context.servlet.AbstractAttributeMap;
21
22
23
24 /**
25  * PortletRequest headers as Map.
26  *
27  * @author Stan Silvert (latest modification by $Author: matzew $)
28  * @version $Revision: 1.1 $ $Date: 2005/01/26 17:03:09 $
29  * $Log: RequestHeaderMap.java,v $
30  * Revision 1.1 2005/01/26 17:03:09 matzew
31  * MYFACES-86. portlet support provided by Stan Silver (JBoss Group)
32  *
33  */

34 public class RequestHeaderMap extends AbstractAttributeMap
35 {
36     private final PortletRequest _portletRequest;
37
38     RequestHeaderMap(PortletRequest portletRequest)
39     {
40         _portletRequest = portletRequest;
41     }
42
43     protected Object JavaDoc getAttribute(String JavaDoc key)
44     {
45         return _portletRequest.getProperty(key);
46     }
47
48     protected void setAttribute(String JavaDoc key, Object JavaDoc value)
49     {
50         throw new UnsupportedOperationException JavaDoc(
51             "Cannot set PortletRequest property");
52     }
53
54     protected void removeAttribute(String JavaDoc key)
55     {
56         throw new UnsupportedOperationException JavaDoc(
57             "Cannot remove PortletRequest property");
58     }
59
60     protected Enumeration JavaDoc getAttributeNames()
61     {
62         return _portletRequest.getPropertyNames();
63     }
64 }
65
Popular Tags