You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2001/09/01 02:52:37 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/session SessionExpirer.java
costin 01/08/31 17:52:37
Modified: src/share/org/apache/tomcat/modules/session
SessionExpirer.java
Log:
More debug statements, start when tomcat is starting ( no need to run expirer when tomcat is
not running ).
Recycle the session after expiring it.
Revision Changes Path
1.4 +7 -2 jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SessionExpirer.java
Index: SessionExpirer.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SessionExpirer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SessionExpirer.java 2001/04/21 17:49:35 1.3
+++ SessionExpirer.java 2001/09/01 00:52:37 1.4
@@ -113,14 +113,14 @@
// XXX use contextInit/shutdown for local modules
- public void engineInit( ContextManager cm ) throws TomcatException {
+ public void engineStart( ContextManager cm ) throws TomcatException {
expirer=new Expirer();
expirer.setCheckInterval( checkInterval );
expirer.setExpireCallback( new SessionExpireCallback(this, debug) );
expirer.start();
}
- public void engineShutdown( ContextManager cm ) throws TomcatException {
+ public void engineStop( ContextManager cm ) throws TomcatException {
expirer.stop();
}
@@ -128,6 +128,7 @@
TimeStamp ts=session.getTimeStamp();
if( state==ServerSession.STATE_NEW ) {
+ if( debug > 0 ) log("Registering new session for expiry checks");
ts.setNew(true);
ts.setValid(true);
@@ -139,6 +140,7 @@
expirer.addManagedObject( ts );
} else if( state==ServerSession.STATE_EXPIRED ) {
+ if( debug > 0 ) log("Removing expired session from expiry checks");
expirer.removeManagedObject( ts );
}
return state;
@@ -162,6 +164,9 @@
se.log( "Session expired " + sses);
}
sses.setState( ServerSession.STATE_EXPIRED );
+ // After expiring it, we clean up.
+ if( debug > 0 ) se.log( "Recycling " + sses);
+ sses.recycle();
}
}
}