tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session ManagerBase.java PersistentManagerBase.java StandardManager.java StandardSession.java
Date Tue, 08 Jul 2003 06:28:02 GMT
remm        2003/07/07 23:28:02

  Modified:    catalina/src/share/org/apache/catalina/session
                        ManagerBase.java PersistentManagerBase.java
                        StandardManager.java StandardSession.java
  Log:
  - Remove session recycling.
  
  Revision  Changes    Path
  1.19      +26 -38    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/ManagerBase.java
  
  Index: ManagerBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ManagerBase.java	24 Apr 2003 22:14:59 -0000	1.18
  +++ ManagerBase.java	8 Jul 2003 06:28:02 -0000	1.19
  @@ -207,12 +207,6 @@
   
   
       /**
  -     * The set of previously recycled Sessions for this Manager.
  -     */
  -    protected ArrayList recycled = new ArrayList();
  -
  -
  -    /**
        * The set of currently active Sessions for this Manager, keyed by
        * session identifier.
        */
  @@ -719,19 +713,7 @@
        * because it reads it from the Store.
        */
       public Session createEmptySession() {
  -        Session session = null;
  -        synchronized (recycled) {
  -            int size = recycled.size();
  -            if (size > 0) {
  -                session = (Session) recycled.get(size - 1);
  -                recycled.remove(size - 1);
  -            }
  -        }
  -        if (session != null)
  -            session.setManager(this);
  -        else
  -            session = getNewSession();
  -        return(session);
  +        return (getNewSession());
       }
   
   
  @@ -915,22 +897,13 @@
       }
   
   
  -    /**
  -     * Add this Session to the recycle collection for this Manager.
  -     *
  -     * @param session Session to be recycled
  -     */
  -    protected void recycle(Session session) {
  -        synchronized (recycled) {
  -            recycled.add(session);
  -        }
  -    }
  -
       public void setSessionCounter(int sessionCounter) {
           this.sessionCounter = sessionCounter;
       }
   
  -    /** Total sessions created by this manager.
  +
  +    /** 
  +     * Total sessions created by this manager.
        *
        * @return sessions created
        */
  @@ -938,8 +911,10 @@
           return sessionCounter;
       }
   
  -    /** Number of duplicated session IDs generated by the random source.
  -     *  Anything bigger than 0 means problems.
  +
  +    /** 
  +     * Number of duplicated session IDs generated by the random source.
  +     * Anything bigger than 0 means problems.
        *
        * @return
        */
  @@ -947,11 +922,14 @@
           return duplicates;
       }
   
  +
       public void setDuplicates(int duplicates) {
           this.duplicates = duplicates;
       }
   
  -    /** Returns the number of active sessions
  +
  +    /** 
  +     * Returns the number of active sessions
        *
        * @return number of sessions active
        */
  @@ -959,7 +937,9 @@
           return sessions.size();
       }
   
  -    /** Max number of concurent active sessions
  +
  +    /**
  +     * Max number of concurent active sessions
        *
        * @return
        */
  @@ -967,11 +947,14 @@
           return maxActive;
       }
   
  +
       public void setMaxActive(int maxActive) {
           this.maxActive = maxActive;
       }
   
  -    /** For debugging: return a list of all session ids currently active
  +
  +    /** 
  +     * For debugging: return a list of all session ids currently active
        *
        */
       public String listSessionIds() {
  @@ -983,7 +966,9 @@
           return sb.toString();
       }
   
  -    /** For debugging: get a session attribute
  +
  +    /** 
  +     * For debugging: get a session attribute
        *
        * @param sessionId
        * @param key
  @@ -1000,6 +985,7 @@
           return o.toString();
       }
   
  +
       public void expireSession( String sessionId ) {
           Session s=(Session)sessions.get(sessionId);
           if( s==null ) {
  @@ -1009,6 +995,7 @@
           s.expire();
       }
   
  +
       public String getLastAccessedTime( String sessionId ) {
           Session s=(Session)sessions.get(sessionId);
           if( s==null ) {
  @@ -1017,6 +1004,7 @@
           }
           return new Date(s.getLastAccessedTime()).toString();
       }
  +
   
       // -------------------- JMX and Registration  --------------------
       protected String domain;
  
  
  
  1.8       +4 -5      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java
  
  Index: PersistentManagerBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PersistentManagerBase.java	17 Mar 2003 19:25:11 -0000	1.7
  +++ PersistentManagerBase.java	8 Jul 2003 06:28:02 -0000	1.8
  @@ -684,7 +684,6 @@
       public void load() {
   
           // Initialize our internal data structures
  -        recycled.clear();
           sessions.clear();
   
           if (store == null)
  
  
  
  1.10      +4 -5      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardManager.java
  
  Index: StandardManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- StandardManager.java	23 May 2003 10:52:20 -0000	1.9
  +++ StandardManager.java	8 Jul 2003 06:28:02 -0000	1.10
  @@ -393,7 +393,6 @@
               log.debug("Start: Loading persisted sessions");
   
           // Initialize our internal data structures
  -        recycled.clear();
           sessions.clear();
   
           // Open an input stream to the specified pathname, if any
  
  
  
  1.18      +4 -12     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java
  
  Index: StandardSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- StandardSession.java	29 Apr 2003 21:52:04 -0000	1.17
  +++ StandardSession.java	8 Jul 2003 06:28:02 -0000	1.18
  @@ -704,9 +704,6 @@
   
               // We have completed expire of this session
               expiring = false;
  -            if ((manager != null) && (manager instanceof ManagerBase)) {
  -                recycle();
  -            }
   
           }
   
  @@ -803,12 +800,7 @@
           setPrincipal(null);
           isNew = false;
           isValid = false;
  -        Manager savedManager = manager;
           manager = null;
  -
  -        // Tell our Manager that this Session has been recycled
  -        if ((savedManager != null) && (savedManager instanceof ManagerBase))
  -            ((ManagerBase) savedManager).recycle(this);
   
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message