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/03/23 03:24:36 UTC

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

costin      01/03/22 18:24:36

  Modified:    src/share/org/apache/tomcat/modules/session
                        SessionExpirer.java SimpleSessionStore.java
  Log:
  Allow access to the Expirer ( for a future monitoring page )
  
  Increase and allow configuration of the session pool.
  
  Allow access ( find ) to sessions by context and id ( again, for monitoring
  pages )
  
  Revision  Changes    Path
  1.2       +4 -0      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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SessionExpirer.java	2001/03/21 06:54:01	1.1
  +++ SessionExpirer.java	2001/03/23 02:24:36	1.2
  @@ -105,6 +105,10 @@
   	checkInterval=secs;
       }
   
  +    public Expirer getExpirer() {
  +	return expirer;
  +    }
  +
       // -------------------- Tomcat request events --------------------
       public void engineInit( ContextManager cm ) throws TomcatException {
   	expirer.setCheckInterval( checkInterval );
  
  
  
  1.14      +27 -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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SimpleSessionStore.java	2001/03/21 06:54:01	1.13
  +++ SimpleSessionStore.java	2001/03/23 02:24:36	1.14
  @@ -86,6 +86,8 @@
   public final class SimpleSessionStore  extends BaseInterceptor {
       int manager_note;
       int maxActiveSessions = -1;
  +    int size=16;
  +    int max=256;
       
       public SimpleSessionStore() {
       }
  @@ -96,6 +98,14 @@
   	maxActiveSessions=count;
       }
   
  +    public void setInitialPool( int initial ) {
  +	size=initial;
  +    }
  +
  +    public void setMaxPool( int max ) {
  +	this.max=max;
  +    }
  +    
       // -------------------- Tomcat request events --------------------
       public void engineInit( ContextManager cm ) throws TomcatException {
   	// set-up a per/container note for StandardManager
  @@ -230,6 +240,11 @@
   	return sm.getSessionIds();
       }
       
  +    public Enumeration getSessions(Context ctx) {
  +	SimpleSessionManager sm= getManager( ctx );
  +	return sm.getSessions();
  +    }
  +    
       public int getSessionCount(Context ctx) {
   	SimpleSessionManager sm= getManager( ctx );
   	return sm.getSessionCount();
  @@ -239,6 +254,13 @@
   	SimpleSessionManager sm= getManager( ctx );
   	return sm.getRecycledCount();
       }
  +
  +    public ServerSession findSession( Context ctx, String sessionId)
  +    {
  +	SimpleSessionManager sM = getManager( ctx );    
  +	return sM.findSession( sessionId );
  +    }
  +
       // -------------------- Internal methods --------------------
   
       
  @@ -271,12 +293,16 @@
   	    return sessions.keys();
   	}
   
  +	public Enumeration getSessions() {
  +	    return sessions.elements();
  +	}
  +
   	public int getSessionCount() {
   	    return sessions.size();
   	}
   
   	public int getRecycledCount() {
  -	    return recycled.getMax();
  +	    return recycled.getCount();
   	}
   	
   	public ServerSession findSession(String id) {