cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res LocalStrings.properties
luehe 2003/11/06 11:05:23 Modified:util/java/org/apache/tomcat/util/threads ThreadPool.java util/java/org/apache/tomcat/util/threads/res LocalStrings.properties Log: More i18n: added 'threadpool.thread_error' error code Revision ChangesPath 1.18 +6 -5 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java Index: ThreadPool.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- ThreadPool.java 6 Nov 2003 18:23:20 - 1.17 +++ ThreadPool.java 6 Nov 2003 19:05:23 - 1.18 @@ -647,7 +647,7 @@ try { while(true) { try { - /* Wait for work. */ +/* Wait for work. */ synchronized(this) { if(!shouldRun !shouldTerminate) { this.wait(); @@ -683,8 +683,9 @@ } } } catch(Throwable t) { - p.log.error(Caught exception executing + toRun.toString() + , terminating thread, t); -/* + p.log.error(sm.getString(threadpool.thread_error, + t, toRun.toString())); + /* * The runnable throw an exception (can be even a ThreadDeath), * signalling that the thread die. * @@ -698,8 +699,8 @@ if(shouldRun) { shouldRun = false; /* - * Notify the pool that the thread is now idle. -*/ + * Notify the pool that the thread is now idle. + */ p.returnController(this); } } 1.3 +2 -1 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res/LocalStrings.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalStrings.properties 3 Nov 2003 21:54:24 - 1.2 +++ LocalStrings.properties 6 Nov 2003 19:05:23 - 1.3 @@ -1,2 +1,3 @@ threadpool.busy=All threads ({0}) are currently busy, waiting. Increase maxThreads ({1}) or check the servlet status -threadpool.max_threads_too_low=maxThreads setting ({0}) too low, set to {1} \ No newline at end of file +threadpool.max_threads_too_low=maxThreads setting ({0}) too low, set to {1} +threadpool.thread_error=Caught exception ({0}) executing {1}, terminating thread - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res LocalStrings.properties
luehe 2003/11/03 13:54:24 Modified:util/java/org/apache/tomcat/util/threads ThreadPool.java util/java/org/apache/tomcat/util/threads/res LocalStrings.properties Log: Correct any maxThreads settings 10 Revision ChangesPath 1.16 +10 -2 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java Index: ThreadPool.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- ThreadPool.java 28 Oct 2003 20:03:01 - 1.15 +++ ThreadPool.java 3 Nov 2003 21:54:24 - 1.16 @@ -83,6 +83,7 @@ * Default values ... */ public static final int MAX_THREADS = 200; +public static final int MAX_THREADS_MIN = 10; public static final int MAX_SPARE_THREADS = 50; public static final int MIN_SPARE_THREADS = 4; public static final int WORK_WAIT_TIMEOUT = 60*1000; @@ -200,7 +201,14 @@ } public void setMaxThreads(int maxThreads) { -this.maxThreads = maxThreads; +if (maxThreads MAX_THREADS_MIN) { +log.warn(sm.getString(threadpool.max_threads_too_low, + new Integer(maxThreads), + new Integer(MAX_THREADS_MIN))); +this.maxThreads = MAX_THREADS_MIN; +} else { +this.maxThreads = maxThreads; +} } public int getMaxThreads() { @@ -370,7 +378,7 @@ private static void logFull(Log loghelper, int currentThreadCount, int maxThreads) { if( logfull ) { -log.error(sm.getString(threads.busy, +log.error(sm.getString(threadpool.busy, new Integer(currentThreadCount), new Integer(maxThreads))); logfull=false; 1.2 +2 -1 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res/LocalStrings.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LocalStrings.properties 28 Oct 2003 20:03:01 - 1.1 +++ LocalStrings.properties 3 Nov 2003 21:54:24 - 1.2 @@ -1 +1,2 @@ -threads.busy=All threads ({0}) are currently busy, waiting. Increase maxThreads ({1}) or check the servlet status \ No newline at end of file +threadpool.busy=All threads ({0}) are currently busy, waiting. Increase maxThreads ({1}) or check the servlet status +threadpool.max_threads_too_low=maxThreads setting ({0}) too low, set to {1} \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res LocalStrings.properties
luehe 2003/10/28 12:03:01 Modified:util/java/org/apache/tomcat/util/threads ThreadPool.java Added: util/java/org/apache/tomcat/util/threads/res LocalStrings.properties Log: Added support for localized messages Revision ChangesPath 1.15 +19 -14 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java Index: ThreadPool.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/ThreadPool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ThreadPool.java 11 Sep 2003 04:05:02 - 1.14 +++ ThreadPool.java 28 Oct 2003 20:03:01 - 1.15 @@ -63,6 +63,7 @@ import java.util.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.tomcat.util.res.StringManager; /** * A thread pool that is trying to copy the apache process management. @@ -70,7 +71,13 @@ * @author Gal Shachor */ public class ThreadPool { -static Log log = LogFactory.getLog(ThreadPool.class); + +private static Log log = LogFactory.getLog(ThreadPool.class); + +private static StringManager sm = +StringManager.getManager(org.apache.tomcat.util.threads.res); + +private static boolean logfull=true; /* * Default values ... @@ -140,17 +147,16 @@ */ protected int sequence = 1; + /** - * Helper object for logging - **/ -//Log loghelper = Log.getLog(tc/ThreadPool, ThreadPool); - + * Constructor. + */ public ThreadPool() { -maxThreads = MAX_THREADS; +maxThreads = MAX_THREADS; maxSpareThreads = MAX_SPARE_THREADS; minSpareThreads = MIN_SPARE_THREADS; -currentThreadCount = 0; -currentThreadsBusy = 0; +currentThreadCount = 0; +currentThreadsBusy = 0; stopThePool = false; } @@ -361,13 +367,12 @@ return c; } -static boolean logfull=true; -public static void logFull(Log loghelper, int currentThreadCount, int maxThreads) { +private static void logFull(Log loghelper, int currentThreadCount, +int maxThreads) { if( logfull ) { -log.error(All threads are busy, waiting. Please + -increase maxThreads or check the servlet + - status + currentThreadCount + + -maxThreads ); +log.error(sm.getString(threads.busy, + new Integer(currentThreadCount), + new Integer(maxThreads))); logfull=false; } else if( log.isDebugEnabled() ) { log.debug(All threads are busy + currentThreadCount + + 1.1 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads/res/LocalStrings.properties Index: LocalStrings.properties === threads.busy=All threads ({0}) are currently busy, waiting. Increase maxThreads ({1}) or check the servlet status - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]