{
ContentPage page = requestContext.getPage();
String key = page.getId();
boolean loggedOn = requestContext.getRequest().getUserPrincipal() != null;
boolean anonymous = !loggedOn;
PageActionAccess pageActionAccess = null;
Map sessionActions = null;
synchronized (this)
{
sessionActions = (Map) requestContext.getSessionAttribute(PAGE_ACTION_ACCESS_MAP_SESSION_ATTR_KEY);
if (sessionActions == null)
{
sessionActions = new HashMap();
requestContext.setSessionAttribute(PAGE_ACTION_ACCESS_MAP_SESSION_ATTR_KEY, sessionActions);
}
else
{
pageActionAccess = (PageActionAccess) sessionActions.get(key);
}
}
synchronized (sessionActions)
{
if (pageActionAccess == null)
{
pageActionAccess = new PageActionAccess(anonymous, page);
sessionActions.put(key, pageActionAccess);
}
else
{
pageActionAccess.checkReset(anonymous, page);
}
}
return pageActionAccess;
}