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/08/12 04:16:20 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/session SimpleSessionStore.java

costin      01/08/11 19:16:20

  Modified:    src/share/org/apache/tomcat/modules/session
                        SimpleSessionStore.java
  Log:
  Fix the session shutdown problem.
  
  Add better debugging.
  
  Revision  Changes    Path
  1.16      +18 -1     jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java
  
  Index: SimpleSessionStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SimpleSessionStore.java	2001/03/26 14:47:58	1.15
  +++ SimpleSessionStore.java	2001/08/12 02:16:20	1.16
  @@ -198,6 +198,8 @@
   
   	if( sm == null ) {
   	    sm=new SimpleSessionManager();
  +	    sm.setDebug( debug );
  +	    sm.setModule( this );
   	    ctx.getContainer().setNote( manager_note, sm );
   	}
       }
  @@ -209,7 +211,8 @@
       public void contextShutdown( Context ctx )
   	throws TomcatException
       {
  -	if( debug > 0 ) ctx.log("Removing sessions from " + ctx );
  +	if( debug > 0 )
  +	    log("Removing sessions from " + ctx );
   
   	SimpleSessionManager sm=getManager(ctx);
   	Enumeration ids = sm.getSessionIds();
  @@ -218,6 +221,9 @@
   	    ServerSession session = sm.findSession(id);
   	    if (!session.getTimeStamp().isValid())
   		continue;
  +	    if( debug > 0 )
  +		log( "Shuting down " + id );
  +	    session.setState( ServerSession.STATE_SUSPEND );
   	    session.setState( ServerSession.STATE_EXPIRED );
   	}
       }
  @@ -274,6 +280,8 @@
        */
       public static class SimpleSessionManager  
       {
  +	private int debug=0;
  +	private BaseInterceptor mod;
   	/** The set of previously recycled Sessions for this Manager.
   	 */
   	protected SimplePool recycled = new SimplePool();
  @@ -287,6 +295,14 @@
   	public SimpleSessionManager() {
   	}
   
  +	public void setDebug( int l ) {
  +	    debug=l;
  +	}
  +
  +	public void setModule( BaseInterceptor bi ) {
  +	    mod=bi;
  +	}
  +
   	// --------------------------------------------- Public Methods
   
   	public Enumeration getSessionIds() {
  @@ -316,6 +332,7 @@
   	 * @param session Session to be removed
   	 */
   	public void removeSession(ServerSession session) {
  +	    if( debug>0 ) mod.log( "removeSession " + session );
   	    sessions.remove(session.getId().toString());
   	    recycled.put(session);
   	    session.setValid(false);