View Javadoc

1   package org.appfuse.webapp.action;
2   
3   import org.appfuse.model.User;
4   import org.appfuse.webapp.listener.UserCounterListener;
5   
6   import java.io.Serializable;
7   import java.util.ArrayList;
8   import java.util.List;
9   import java.util.Set;
10  
11  public class ActiveUserList extends BasePage implements Serializable {
12      private static final long serialVersionUID = -2725378005612769815L;
13  
14      public ActiveUserList() {
15          setSortColumn("username");
16      }
17      
18      @SuppressWarnings("unchecked")
19      public List getUsers() {
20          Set users = (Set) getServletContext().getAttribute(UserCounterListener.USERS_KEY);
21          if (users != null) {
22              return sort(new ArrayList<User>(users));
23          } else {
24              return new ArrayList();
25          }
26      }
27  }