Ejemplo n.º 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();
   }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 3
0
  /** Attach the given user node to this session. */
  public void login(INode usernode) {
    if (usernode == null) {
      userHandle = null;
      uid = null;
    } else {
      userHandle = ((Node) usernode).getHandle();
      uid = usernode.getElementName();
    }

    lastModified = System.currentTimeMillis();
    modifiedInRequest = true;
  }
Ejemplo n.º 4
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;
 }