1 5 6 package org.exoplatform.commons.map; 7 8 import javax.portlet.PortletSession; 9 import java.util.Enumeration ; 10 11 16 public class SessionMap extends AbstractMap 17 { 18 private PortletSession p_session; 19 20 public SessionMap( PortletSession session ) 21 { 22 p_session = session; 23 } 24 25 protected Object getAttribute( String name ) 26 { 27 if (p_session != null) { 28 return p_session.getAttribute( name ); 29 } else { 30 return null; 31 } 32 } 33 34 protected void setAttribute( String name, Object value ) 35 { 36 if (p_session != null) 37 p_session.setAttribute( name, value ); 38 } 39 40 protected void removeAttribute( String name ) 41 { 42 if (p_session != null) 43 p_session.removeAttribute( name ); 44 } 45 46 protected Enumeration getAttributeNames() 47 { 48 if (p_session != null) 49 return p_session.getAttributeNames(); 50 else 51 return null; 52 } 53 } 54 | Popular Tags |