More tidying...
This commit is contained in:
parent
510cd5050f
commit
7fcdd4a6ff
|
@ -47,25 +47,22 @@ import javax.servlet.http.HttpSession;
|
|||
* @author Ben Alex
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SessionRegistryImpl implements SessionRegistry,
|
||||
ApplicationListener {
|
||||
// ~ Instance fields
|
||||
// ========================================================
|
||||
public class SessionRegistryImpl implements SessionRegistry, ApplicationListener {
|
||||
// ~ Instance fields ===============================================================================================
|
||||
|
||||
private Map principals = Collections.synchronizedMap(new HashMap()); // <principal:Object,SessionIdSet>
|
||||
private Map sessionIds = Collections.synchronizedMap(new HashMap()); // <sessionId:Object,SessionInformation>
|
||||
|
||||
// ~ Methods
|
||||
// ================================================================
|
||||
// ~ Methods =======================================================================================================
|
||||
|
||||
public Object[] getAllPrincipals() {
|
||||
return principals.keySet().toArray();
|
||||
}
|
||||
|
||||
public SessionInformation[] getAllSessions(Object principal,
|
||||
boolean includeExpiredSessions) {
|
||||
public SessionInformation[] getAllSessions(Object principal, boolean includeExpiredSessions) {
|
||||
Set sessionsUsedByPrincipal = (Set) principals.get(principal);
|
||||
if (sessionsUsedByPrincipal == null) {
|
||||
|
||||
if (sessionsUsedByPrincipal == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -116,8 +113,7 @@ public class SessionRegistryImpl implements SessionRegistry,
|
|||
removeSessionInformation(sessionId);
|
||||
}
|
||||
|
||||
sessionIds.put(sessionId, new SessionInformation(principal, sessionId,
|
||||
new Date()));
|
||||
sessionIds.put(sessionId, new SessionInformation(principal, sessionId, new Date()));
|
||||
|
||||
Set sessionsUsedByPrincipal = (Set) principals.get(principal);
|
||||
|
||||
|
|
Loading…
Reference in New Issue