1 15 package org.apache.tapestry.portlet; 16 17 import java.util.List ; 18 19 import javax.portlet.PortletSession; 20 21 import org.apache.hivemind.util.Defense; 22 import org.apache.tapestry.describe.DescriptionReceiver; 23 import org.apache.tapestry.web.WebSession; 24 import org.apache.tapestry.web.WebUtils; 25 26 32 public class PortletWebSession implements WebSession 33 { 34 private final PortletSession _portletSession; 35 36 public PortletWebSession(final PortletSession portletSession) 37 { 38 Defense.notNull(portletSession, "portletSession"); 39 40 _portletSession = portletSession; 41 } 42 43 public void describeTo(DescriptionReceiver receiver) 44 { 45 receiver.describeAlternate(_portletSession); 46 } 47 48 public String getId() 49 { 50 return _portletSession.getId(); 51 } 52 53 public boolean isNew() 54 { 55 return _portletSession.isNew(); 56 } 57 58 public List getAttributeNames() 59 { 60 return WebUtils.toSortedList(_portletSession.getAttributeNames()); 61 } 62 63 public Object getAttribute(String name) 64 { 65 return _portletSession.getAttribute(name); 66 } 67 68 public void setAttribute(String name, Object attribute) 69 { 70 _portletSession.setAttribute(name, attribute); 71 } 72 73 } | Popular Tags |