cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads Expirer.java Reaper.java

2004-09-17 Thread amyroh
amyroh  2004/09/17 11:34:19

  Modified:coyote/src/java/org/apache/coyote/tomcat4 OutputBuffer.java
   http11/src/test/java/org/apache/coyote/http11
RandomAdapter.java
   jk/java/org/apache/ajp Ajp13Packet.java Logger.java
NegociationHandler.java
   jk/java/org/apache/ajp/tomcat4 JkServlet.java
   jk/java/org/apache/jk/common MsgAjp.java Shm.java
   jk/jkant/java/org/apache/jk/ant/compilers MsvcCompiler.java
MsvcLinker.java MwccCompiler.java MwldLinker.java
   naming/src/org/apache/naming/modules/fs FileDirContext.java
   util/java/org/apache/tomcat/util IntrospectionUtils.java
   util/java/org/apache/tomcat/util/buf B2CConverter.java
Base64.java UDecoder.java UEncoder.java
UTF8Decoder.java
   util/java/org/apache/tomcat/util/collections SimplePool.java
   util/java/org/apache/tomcat/util/http Cookies.java
Parameters.java ServerCookie.java
   util/java/org/apache/tomcat/util/threads Expirer.java
Reaper.java
  Log:
  More logging changes - let me know if you see any problems with'em.
  
  Revision  ChangesPath
  1.14  +5 -1  
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/OutputBuffer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- OutputBuffer.java 24 Feb 2004 08:54:29 -  1.13
  +++ OutputBuffer.java 17 Sep 2004 18:34:18 -  1.14
  @@ -40,6 +40,9 @@
   implements ByteChunk.ByteOutputChannel, CharChunk.CharOutputChannel {
   
   
  +private static org.apache.commons.logging.Log log=
  +org.apache.commons.logging.LogFactory.getLog( OutputBuffer.class );
  +
   // -- Constants
   
   
  @@ -664,7 +667,8 @@
   
   
   protected void log( String s ) {
  - System.out.println(OutputBuffer:  + s);
  +if (log.isDebugEnabled()) 
  +log.debug(OutputBuffer:  + s);
   }
   
   
  
  
  
  1.3   +14 -6 
jakarta-tomcat-connectors/http11/src/test/java/org/apache/coyote/http11/RandomAdapter.java
  
  Index: RandomAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/test/java/org/apache/coyote/http11/RandomAdapter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RandomAdapter.java27 Feb 2004 15:14:08 -  1.2
  +++ RandomAdapter.java17 Sep 2004 18:34:18 -  1.3
  @@ -33,6 +33,8 @@
   public class RandomAdapter
   implements Adapter {
   
  +private static org.apache.commons.logging.Log log=
  +org.apache.commons.logging.LogFactory.getLog( RandomAdapter.class );
   
   public static final String CRLF = \r\n;
   public static final byte[] b = 0123456789\r\n.getBytes();
  @@ -60,13 +62,15 @@
   case 0:
   
   // 0) Do nothing
  -System.out.println(Response 0);
  +if (log.isDebugEnabled())
  +log.debug(Response 0);
   break;
   
   case 1:
   
   // 1) Set content length, and write the appropriate content
  -System.out.println(Response 1);
  +if (log.isDebugEnabled())
  +log.debug(Response 1);
   res.setContentLength(b.length);
   bc.setBytes(b, 0, b.length);
   res.doWrite(bc);
  @@ -76,7 +80,8 @@
   
   // 2) Read the request data, and print out the number of bytes
   // read
  -System.out.println(Response 2);
  +if (log.isDebugEnabled())
  +log.debug(Response 2);
   while (nRead = 0) {
   nRead = req.doRead(bc);
   buf = (Read  + nRead +  bytes\r\n).getBytes();
  @@ -88,7 +93,8 @@
   case 3:
   
   // 3) Return 204 (no content), while reading once on input
  -System.out.println(Response 3);
  +if (log.isDebugEnabled())
  +log.debug(Response 3);
   res.setStatus(204);
   nRead = req.doRead(bc);
   res.setHeader(Info, Read  + nRead +  bytes);
  @@ -97,7 +103,8 @@
   case 4:
   
   // 4) Do a request dump
  -System.out.println(Response 4);
  +if (log.isDebugEnabled())
  +log.debug(Response 4);
   sbuf.append(Request dump:);
   sbuf.append(CRLF);
   sbuf.append(req.method());
  

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/threads Expirer.java Reaper.java ThreadPool.java ThreadPoolRunnable.java

2002-01-06 Thread costin

costin  02/01/06 00:34:56

  Modified:util/java/org/apache/tomcat/util/http BaseRequest.java
  Added:   util/java/org/apache/tomcat/util/log Log.java
LogHandler.java LogManager.java
   util/java/org/apache/tomcat/util/threads Expirer.java
Reaper.java ThreadPool.java ThreadPoolRunnable.java
  Log:
  Added 'notes' - to store various information associated with the request.
  ( with fast access time )
  
  Imported the threads from tc. The connector will manage the threads itself,
  it'll be especially important for jni and other channels ( doors maybe ) ( where
  the threads will be created on the C side )
  
  Revision  ChangesPath
  1.4   +11 -1 
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/BaseRequest.java
  
  Index: BaseRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/BaseRequest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BaseRequest.java  26 Jun 2001 19:38:12 -  1.3
  +++ BaseRequest.java  6 Jan 2002 08:34:56 -   1.4
  @@ -58,7 +58,7 @@
   /***
* Description: Base http request object.  *
* Author:  Keving Seguin [[EMAIL PROTECTED]]  *
  - * Version: $Revision: 1.3 $   *
  + * Version: $Revision: 1.4 $   *
***/
   
   package org.apache.tomcat.util.http;
  @@ -332,6 +332,16 @@
   // sessions, and on the tomcat side to format the session ids.
   public MessageBytes jvmRoute() {
   return tomcatInstanceId;
  +}
  +
  +private Object notes[]=new Object[16];
  +
  +public final Object getNote(int id) {
  +return notes[id];
  +}
  +
  +public final void setNote(int id, Object cr) {
  +notes[id]=cr;
   }
   
   /**
  
  
  
  1.1  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/log/Log.java
  
  Index: Log.java
  ===
  /*
   * 
   * 
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:  
   *   This product includes software developed by the 
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Tomcat, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written 
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf