1 33 34 package com.icesoft.faces.context.portlet; 35 36 import com.icesoft.faces.context.AbstractAttributeMap; 37 38 import javax.portlet.PortletSession; 39 import java.util.Enumeration ; 40 41 public class PortletSessionMap extends AbstractAttributeMap { 42 private final PortletSession portletSession; 43 44 45 private final int scope; 46 47 public PortletSessionMap(PortletSession portletSession) { 48 this(portletSession, PortletSession.PORTLET_SCOPE); 49 } 50 51 public PortletSessionMap(PortletSession portletSession, int scope) { 52 this.portletSession = portletSession; 53 this.scope = scope; 54 } 55 56 59 protected Object getAttribute(String key) { 60 return portletSession.getAttribute(key, scope); 61 } 62 63 66 protected void setAttribute(String key, Object value) { 67 portletSession.setAttribute(key, value, scope); 68 } 69 70 73 protected void removeAttribute(String key) { 74 portletSession.removeAttribute(key, scope); 75 } 76 77 80 protected Enumeration getAttributeNames() { 81 return portletSession.getAttributeNames(scope); 82 } 83 84 } 85 | Popular Tags |