tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/http HttpAdapter.java
Date Tue, 02 Nov 1999 17:37:23 GMT
costin      99/11/02 09:37:22

  Modified:    src/share/org/apache/tomcat/core Request.java
                        RequestUtil.java
               src/share/org/apache/tomcat/service
                        Ajp22ConnectionHandler.java
  Added:       src/share/org/apache/tomcat/service/http HttpAdapter.java
  Log:
  - Clean up imports.
  - added HttpAdapter
  
  Revision  Changes    Path
  1.7       +3 -4      jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Request.java	1999/10/28 05:15:24	1.6
  +++ Request.java	1999/11/02 17:37:19	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v 1.6
1999/10/28 05:15:24 costin Exp $
  - * $Revision: 1.6 $
  - * $Date: 1999/10/28 05:15:24 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v 1.7
1999/11/02 17:37:19 costin Exp $
  + * $Revision: 1.7 $
  + * $Date: 1999/11/02 17:37:19 $
    *
    * ====================================================================
    *
  @@ -64,7 +64,6 @@
   
   package org.apache.tomcat.core;
   
  -import org.apache.tomcat.core.*;
   import org.apache.tomcat.util.*;
   import java.io.*;
   import java.net.*;
  
  
  
  1.4       +3 -4      jakarta-tomcat/src/share/org/apache/tomcat/core/RequestUtil.java
  
  Index: RequestUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestUtil.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RequestUtil.java	1999/10/31 19:28:01	1.3
  +++ RequestUtil.java	1999/11/02 17:37:19	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestUtil.java,v
1.3 1999/10/31 19:28:01 costin Exp $
  - * $Revision: 1.3 $
  - * $Date: 1999/10/31 19:28:01 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestUtil.java,v
1.4 1999/11/02 17:37:19 costin Exp $
  + * $Revision: 1.4 $
  + * $Date: 1999/11/02 17:37:19 $
    *
    * ====================================================================
    *
  @@ -64,7 +64,6 @@
   
   package org.apache.tomcat.core;
   
  -import org.apache.tomcat.core.*;
   import org.apache.tomcat.util.*;
   import java.io.*;
   import java.net.*;
  
  
  
  1.6       +3 -6      jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java
  
  Index: Ajp22ConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Ajp22ConnectionHandler.java	1999/10/29 23:40:52	1.5
  +++ Ajp22ConnectionHandler.java	1999/11/02 17:37:20	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java,v
1.5 1999/10/29 23:40:52 costin Exp $
  - * $Revision: 1.5 $
  - * $Date: 1999/10/29 23:40:52 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/Ajp22ConnectionHandler.java,v
1.6 1999/11/02 17:37:20 costin Exp $
  + * $Revision: 1.6 $
  + * $Date: 1999/11/02 17:37:20 $
    *
    * ====================================================================
    *
  @@ -149,9 +149,6 @@
   		// final fix on response & request
   		//		rresponse.setServerHeader(server.getServerHeader());
   
  -		String ctxPath = ctx.getPath();
  -		String pathInfo =path.substring(ctxPath.length(),
  -						path.length());
                   //    don't do headers if request protocol is http/0.9
   		if (rrequest.getProtocol() == null) {
   		    rresponse.setOmitHeaders(true);
  
  
  
  1.1                  jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpAdapter.java
  
  Index: HttpAdapter.java
  ===================================================================
  
  
  /*
   * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpAdapter.java,v
1.1 1999/11/02 17:37:22 costin Exp $
   * $Revision: 1.1 $
   * $Date: 1999/11/02 17:37:22 $
   *
   * ====================================================================
   *
   * 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 apache@apache.org.
   *
   * 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 of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat.service.http;
  
  import org.apache.tomcat.util.*;
  import org.apache.tomcat.core.*;
  import org.apache.tomcat.service.*;
  import org.apache.tomcat.net.*;
  import java.io.*;
  import java.net.*;
  import java.util.*;
  
  import org.apache.tomcat.server.HttpServer;
  
  /**
   * @author costin@eng.sun.com
   */
  public class HttpAdapter  implements ServerConnector {
      String handlerClassName;
      TcpEndpoint ep;
      HttpConnectionHandler con;
  
      ContextManager cm;
      
      private InetAddress address;
      // default is 8080
      private int port=8080;
  
      int vport;
  
      private ServerSocketFactory socketFactory;
      private ServerSocket serverSocket;
  
      boolean running = true;
      
      public HttpAdapter() {
  	ep=new TcpEndpoint();
  	con=new HttpConnectionHandler();
  	ep.setConnectionHandler( con );
      }
  
      public void start() throws Exception {
  	if( con==null) throw new Exception( "Invalid ConnectionHandler");
  	ep.setPort(port);
  	if( socketFactory != null) {
  	    ep.setServerSocketFactory( socketFactory );
  	}
  	ep.startEndpoint();
      }
  
      public void stop() throws Exception {
  	ep.stopEndpoint();
      }
  
      public void setContextManager( ContextManager ctx ) {
  	this.cm=ctx;
  	con.setContextManager( ctx );
      }
      
      public void setProperty( String prop, String value) {
  	if("port".equals(prop) ) {
  	    //	    System.out.println("XXX");
  	    port=string2Int(value);
  	}
      }
  
      // XXX use constants, remove dep on HttpServer
      public void setAttribute( String prop, Object value) {
  	if(HttpServer.VHOST_NAME.equals(prop) ) {
  	    //vhost=(String)value;
  	}
  	if(HttpServer.VHOST_PORT.equals(prop) ) {
  	    vport=((Integer)value).intValue();
  	}
  
  	if(HttpServer.VHOST_ADDRESS.equals(prop)) {
  	    address=(InetAddress)value;
  	}
  	if(HttpServer.SERVER.equals(prop)) {
  	    //server=(HttpServer)value;
  	}
  	if(HttpServer.SOCKET_FACTORY.equals(prop)) {
  	    socketFactory=(ServerSocketFactory)value;
  	}
      }
  
      public Object getAttribute( String prop ) {
  	return null;
      }
  
      private int string2Int( String val) {
  	try {
  	    return Integer.parseInt(val);
  	} catch (NumberFormatException nfe) {
  	    return 0;
  	}
      }
  
  
      
  }
      
  
  
  
  

Mime
View raw message