private ScreenState createNewScreenState(String pageName) { ScreenState state = new ScreenState(pageName, screenIdleTimeout); String key = SESSION_KEY_PREFIX + state.getId(); getHttpSession().setAttribute(key, state); currentScreenState.set(state); LOG.debug("Created new screen " + state.getId()); return state; }
@Override public void discardTimedOut() { for (String name : request.getSession(true).getAttributeNames(SESSION_KEY_PREFIX)) { ScreenState screen = (ScreenState) getHttpSession().getAttribute(name); if (screen.isTimedOut()) { LOG.trace("Screen timed out: " + screen.getId()); discard(screen.getId()); } } }
@Override public void discardCurrent() { ScreenState current = current(false); if (current != null) { discard(current.getId()); currentScreenState.clear(); } }
@Override public void discard(String screenId) { if (LOG.isDebugEnabled()) { LOG.debug("Discarding screen " + screenId); } removeFromSession(screenId); ScreenState current = current(false); if (current != null && current.getId().equals(screenId)) { currentScreenState.clear(); } }