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  Changes    Path
  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 -0000      1.14
  +++ ThreadPool.java   28 Oct 2003 20:03:01 -0000      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]

Reply via email to