Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 6707 invoked from network); 5 Nov 2008 21:57:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Nov 2008 21:57:18 -0000 Received: (qmail 32033 invoked by uid 500); 5 Nov 2008 21:57:22 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 31795 invoked by uid 500); 5 Nov 2008 21:57:21 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 31784 invoked by uid 99); 5 Nov 2008 21:57:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2008 13:57:21 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2008 21:56:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 06EB02388875; Wed, 5 Nov 2008 13:56:54 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r711711 - /tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Date: Wed, 05 Nov 2008 21:56:53 -0000 To: dev@tomcat.apache.org From: rjung@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081105215654.06EB02388875@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rjung Date: Wed Nov 5 13:56:52 2008 New Revision: 711711 URL: http://svn.apache.org/viewvc?rev=711711&view=rev Log: Give thisAccessedTime and lastAccessedTime for sessions a clear semantics: - thisAccessedTime will be updated at the beginning and at the end of session use - lastAccessedTime will only be updated at the end of session use This means: - lastAccessedTime is the last access time of a session disregarding any request still being processed on. So this is good to use even from within a request to detect when its own session has been used last before. - thisAccessedTime already gets updated when a new request disregarding any request still being processed on. So this is better for any idleness check or information. - thisAccessedTime >= lastAccessedTime always Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=711711&r1=711710&r2=711711&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java (original) +++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Wed Nov 5 13:56:52 2008 @@ -617,9 +617,8 @@ */ public void access() { - this.lastAccessedTime = this.thisAccessedTime; this.thisAccessedTime = System.currentTimeMillis(); - + if (ACTIVITY_CHECK) { accessCount.incrementAndGet(); } @@ -633,6 +632,8 @@ public void endAccess() { isNew = false; + this.thisAccessedTime = System.currentTimeMillis(); + this.lastAccessedTime = this.thisAccessedTime; if (ACTIVITY_CHECK) { accessCount.decrementAndGet(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org