示例#1
0
 /**
  * Called after a request has been handled.
  *
  * @param reval the request evaluator that handled the request
  */
 public void commit(RequestEvaluator reval, SessionManager smgr) {
   if (modifiedInRequest || cacheLastModified != cacheNode.lastModified()) {
     if (!registered) {
       smgr.registerSession(this);
       registered = true;
     }
     modifiedInRequest = false;
     cacheLastModified = cacheNode.lastModified();
   }
 }
示例#2
0
 /** Set the cache node for this session. */
 public void setCacheNode(INode node) {
   if (node == null) {
     throw new NullPointerException("cache node is null");
   }
   this.cacheNode = node;
   this.cacheLastModified = cacheNode.lastModified();
 }
示例#3
0
 /**
  * Creates a new Session object.
  *
  * @param sessionId ...
  * @param app ...
  */
 public Session(String sessionId, Application app) {
   this.sessionId = sessionId;
   this.app = app;
   this.uid = null;
   this.userHandle = null;
   cacheNode = new TransientNode(app, "session");
   cacheLastModified = cacheNode.lastModified();
   // HACK - decrease timestamp by 1 to notice modifications
   // taking place immediately after object creation
   onSince = System.currentTimeMillis() - 1;
   lastTouched = lastModified = onSince;
 }