public Enumeration getAttributeNames(int i) {
   try {
     return session.getAttributeNames();
   } catch (IllegalStateException e) {
     throw new SessionExpiredException(e);
   }
 }
 /**
  * @see javax.servlet.http.HttpSession#getValueNames()
  * @deprecated
  */
 @Override
 @Deprecated
 public String[] getValueNames() {
   final List objs = new ArrayList();
   for (final Enumeration e = portletSession.getAttributeNames(); e.hasMoreElements(); ) {
     final String key = (String) e.nextElement();
     objs.add(key);
   }
   final String[] values = new String[objs.size()];
   for (int i = 0; i < objs.size(); i++) {
     values[i] = (String) objs.get(i);
   }
   return values;
 }
 /**
  * See note above in run method. Just fiddle with the session to try to cause
  * IllegalStateExceptions before Seam takes over.
  *
  * @param state PersistentFacesState used in rendering
  * @throws IllegalStateException If logged out.
  */
 private void testSession(PersistentFacesState state) throws IllegalStateException {
   FacesContext fc = state.getFacesContext();
   Object o = fc.getExternalContext().getSession(false);
   if (o == null) {
     renderable.renderingException(
         new FatalRenderingException("Session has ended (User Logout?)"));
   } else {
     if (o instanceof HttpSession) {
       HttpSession session = (HttpSession) o;
       session.getAttributeNames();
     } else if (o instanceof PortletSession) {
       PortletSession ps = (PortletSession) o;
       ps.getAttributeNames();
     }
   }
 }
 /** @see javax.servlet.http.HttpSession#getAttributeNames() */
 @Override
 public Enumeration getAttributeNames() {
   return portletSession.getAttributeNames();
 }