コード例 #1
0
 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;
 }
コード例 #2
0
 @Override
 public void discardCurrent() {
   ScreenState current = current(false);
   if (current != null) {
     discard(current.getId());
     currentScreenState.clear();
   }
 }
コード例 #3
0
 @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());
     }
   }
 }
コード例 #4
0
 @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();
   }
 }
コード例 #5
0
 @Override
 public ScreenState current(boolean create) {
   ScreenState current = currentScreenState.get();
   // Remove current state if not for active page
   if (current != null && !current.isForPage(requestGlobals.getActivePageName())) {
     currentScreenState.clear();
     current = null;
   }
   if (current == null && create) {
     return createNewScreenState(requestGlobals.getActivePageName());
   }
   return current;
 }