remm 2003/08/20 01:24:23 Modified: catalina/src/share/org/apache/catalina/core StandardContext.java Log: - Manager checks should be a lot less frequent than the eventual reloader check, or the other container's checks. The current settings would have caused too much strain on the store. - Add a variable to configure the check interval. - Call the persistent manager checks. Revision Changes Path 1.85 +54 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java Index: StandardContext.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- StandardContext.java 19 Aug 2003 17:11:49 -0000 1.84 +++ StandardContext.java 20 Aug 2003 08:24:22 -0000 1.85 @@ -541,6 +541,21 @@ /** + * Frequency of the session expiration, and related manager operations. + * Manager operations will be done once for the specified amount of + * backgrondProcess calls (ie, the lower the amount, the most often the + * checks will occur). + */ + private int managerChecksFrequency = 6; + + + /** + * Iteration count for background processing. + */ + private int count = 0; + + + /** * Caching allowed flag. */ private boolean cachingAllowed = true; @@ -688,7 +703,8 @@ new Boolean(this.available)); } - + + /** * Return the Locale to character set mapper for this Context. */ @@ -975,6 +991,37 @@ this.lazy = lazy; } + + /** + * Return the frequency of manager checks. + */ + public int getManagerChecksFrequency() { + + return (this.managerChecksFrequency); + + } + + + /** + * Set the manager checks frequency. + * + * @param managerChecksFrequency the new manager checks frequency + */ + public void setManagerChecksFrequency(int managerChecksFrequency) { + + if (managerChecksFrequency <= 0) { + return; + } + + int oldManagerChecksFrequency = this.managerChecksFrequency; + this.managerChecksFrequency = managerChecksFrequency; + support.firePropertyChange("managerChecksFrequency", + new Integer(oldManagerChecksFrequency), + new Integer(this.managerChecksFrequency)); + + } + + /** * Return descriptive information about this Container implementation and * the corresponding version number, in the format @@ -4302,12 +4349,16 @@ if (!started) return; - if (getManager() != null) { + count = (count + 1) % managerChecksFrequency; + + if ((getManager() != null) && (count == 0)) { if (getManager() instanceof StandardManager) { ((StandardManager) getManager()).processExpires(); } else if (getManager() instanceof PersistentManagerBase) { PersistentManagerBase pManager = (PersistentManagerBase) getManager(); + pManager.processExpires(); + pManager.processPersistenceChecks(); if ((pManager.getStore() != null) && (pManager.getStore() instanceof StoreBase)) { ((StoreBase) pManager.getStore()).processExpires();
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]