cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java

2002-03-01 Thread remm

remm02/03/01 16:13:01

  Modified:catalina/src/share/org/apache/catalina/connector/warp Tag:
tomcat_40_branch WarpEngine.java
  Log:
  - Update JK and webapp.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.11.2.1  +12 -5 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/Attic/WarpEngine.java
  
  Index: WarpEngine.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/Attic/WarpEngine.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- WarpEngine.java   20 Jul 2001 00:01:06 -  1.11
  +++ WarpEngine.java   2 Mar 2002 00:13:01 -   1.11.2.1
  @@ -69,12 +69,19 @@
   public Container map(Request request, boolean update) {
   this.log(Mapping request);
   if (request instanceof WarpRequest) {
  -WarpRequest wreq=(WarpRequest)request;
  -Host host=wreq.getHost();
  +WarpRequest wreq = (WarpRequest)request;
  +Host host = wreq.getHost();
   if (update) {
  -request.setServerName(host.getName());
  +if (request.getRequest().getServerName() == null) {
  +request.setServerName(host.getName());
  +} else {
  +request.setServerName
  +(request.getRequest().getServerName());
  +}
   }
  -return(host);
  -} else return(super.map(request,update));
  +return (host);
  +} else {
  +return (super.map(request,update));
  +}
   }
   }
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java

2001-07-19 Thread pier

pier01/07/19 17:01:06

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpEngine.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.11  +9 -163
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java
  
  Index: WarpEngine.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WarpEngine.java   2001/01/24 23:10:46 1.10
  +++ WarpEngine.java   2001/07/20 00:01:06 1.11
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -58,177 +58,23 @@
   
   import java.io.IOException;
   import javax.servlet.ServletException;
  -import javax.servlet.ServletRequest;
  -import javax.servlet.http.HttpServletResponse;
  +
   import org.apache.catalina.Container;
  -import org.apache.catalina.Engine;
  -import org.apache.catalina.Globals;
   import org.apache.catalina.Host;
  -import org.apache.catalina.LifecycleException;
   import org.apache.catalina.Request;
   import org.apache.catalina.Response;
   import org.apache.catalina.core.StandardEngine;
   
  -/**
  - *
  - *
  - * @author a href=mailto:[EMAIL PROTECTED];Pier Fumagalli/a
  - * @author Copyright copy; 1999, 2000 a href=http://www.apache.org;The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpEngine.java,v 1.10 2001/01/24 23:10:46 pier Exp $
  - */
   public class WarpEngine extends StandardEngine {
  -
  -// -- CONSTANTS
  -
  -/** Our debug flag status (Used to compile out debugging information). */
  -private static final boolean DEBUG=WarpDebug.DEBUG;
  -/** The descriptive information related to this implementation. */
  -private static final String info=WarpEngine/+WarpConstants.VERSION;
  -
  -//  LOCAL VARIABLES
  -
  -/** The Java class name of the default Mapper class for this Container. */
  -private String mapper=org.apache.catalina.connector.warp.WarpEngineMapper;
  -/** The root path for web applications. */
  -private String appbase=;
  -/** The Host ID to use for the next dynamically configured host. */
  -private int hostid=0;
  -
  -//  CONSTRUCTOR
  -
  -/**
  - * Create a new WarpEngine component with the default basic Valve.
  - */
  -public WarpEngine() {
  -super();
  -super.addDefaultMapper(this.mapper);
  -if (DEBUG) this.debug(New instance created);
  -this.setDebug(9);
  -}
  -
  -// - PUBLIC METHODS
  -
  -public void invoke(Request req, Response res)
  -throws ServletException, IOException {
  -if (DEBUG) this.debug(Invoked);
  -super.invoke(req,res);
  -}
  -
   public Container map(Request request, boolean update) {
  -if (DEBUG) this.debug(Trying to map request to host);
  +this.log(Mapping request);
   if (request instanceof WarpRequest) {
  -WarpRequest r=(WarpRequest)request;
  -
  - Container children[]=this.findChildren();
  - for (int x=0; xchildren.length; x++) {
  - if (children[x] instanceof WarpHost) {
  - WarpHost host=(WarpHost)children[x];
  - if (r.getRequestedHostID()==host.getHostID()) {
  - return(children[x]);
  - }
  -}
  +WarpRequest wreq=(WarpRequest)request;
  +Host host=wreq.getHost();
  +if (update) {
  +request.setServerName(host.getName());
   }
  -}
  -if (DEBUG) this.debug(Trying to map request to host (std));
  -return(super.map(request,update));
  -}
  -
  -/**
  - * Add a default Mapper implementation if none have been configured
  - * explicitly.
  - *
  - * @param mapperClass Java class name of the default Mapper
  - */
  -protected void addDefaultMapper(String 

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java

2000-12-13 Thread pier

pier00/12/13 19:37:12

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpEngine.java
  Log:
  Set the port in the host when this one is constructed.
  
  Revision  ChangesPath
  1.8   +3 -2  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java
  
  Index: WarpEngine.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WarpEngine.java   2000/12/14 01:25:57 1.7
  +++ WarpEngine.java   2000/12/14 03:37:11 1.8
  @@ -75,7 +75,7 @@
* @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a
* @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The
* Apache Software Foundation.
  - * @version CVS $Id: WarpEngine.java,v 1.7 2000/12/14 01:25:57 pier Exp $
  + * @version CVS $Id: WarpEngine.java,v 1.8 2000/12/14 03:37:11 pier Exp $
*/
   public class WarpEngine extends StandardEngine {
   
  @@ -155,12 +155,13 @@
* Create a new WarpHost with the specified host name, setup the appropriate
* values and add it to the list of children.
*/
  -public synchronized WarpHost setupChild(String name) {
  +public synchronized WarpHost setupChild(String name, int port) {
   WarpHost host=(WarpHost)this.findChild(name);
   if (host==null) {
   this.debug("Creating new host "+name);
   host=new WarpHost();
   host.setName(name);
  +host.setPort(port);
   host.setHostID(this.hostid++);
   host.setAppBase(this.appbase);
   this.addChild(host);
  
  
  



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java

2000-12-08 Thread pier

pier00/12/08 01:40:56

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpEngine.java
  Log:
  Added methods for invoking requests within Catalina.
  
  Revision  ChangesPath
  1.5   +67 -9 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java
  
  Index: WarpEngine.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WarpEngine.java   2000/12/08 02:57:04 1.4
  +++ WarpEngine.java   2000/12/08 09:40:55 1.5
  @@ -75,7 +75,7 @@
* @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a
* @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The
* Apache Software Foundation.
  - * @version CVS $Id: WarpEngine.java,v 1.4 2000/12/08 02:57:04 pier Exp $
  + * @version CVS $Id: WarpEngine.java,v 1.5 2000/12/08 09:40:55 pier Exp $
*/
   public class WarpEngine extends StandardEngine {
   
  @@ -90,6 +90,10 @@
   
   /** The Java class name of the default Mapper class for this Container. */
   private String mapper="org.apache.catalina.connector.warp.WarpEngineMapper";
  +/** The root path for web applications. */
  +private String appbase="";
  +/** The Host ID to use for the next dynamically configured host. */
  +private int hostid=0;
   
   //  CONSTRUCTOR
   
  @@ -111,14 +115,68 @@
   }
   
   /**
  - * Add a default Mapper implementation if none have been configured
  - * explicitly.
  - *
  - * @param mapperClass Java class name of the default Mapper
  - */
  -public void addDefaultMapper(String mapper) {
  -if (DEBUG) this.debug("Adding default mapper "+mapper);
  -super.addDefaultMapper(this.mapper);
  + * Create a new WarpHost with the specified host name, setup the appropriate
  + * values and add it to the list of children.
  + */
  +public synchronized WarpHost setupChild(String name) {
  +WarpHost host=(WarpHost)this.findChild(name);
  +if (host==null) {
  +this.debug("Creating new host "+name);
  +host=new WarpHost();
  +host.setName(name);
  +host.setHostID(this.hostid++);
  +host.setAppBase(this.appbase);
  +this.addChild(host);
  +}
  +return(host);
  +}
  +
  +/**
  + * Add a child WarpHost to the current WarpEngine.
  + */
  +public void addChild(Container child) {
  +if (child instanceof WarpHost) {
  +WarpHost byid=this.findChild(((WarpHost)child).getHostID());
  +if (byid!=null) {
  +throw new IllegalArgumentException("Host "+byid.getName()+
  +  " already configured with ID="+byid.getHostID());
  +} else {
  +super.addChild(child);
  +}
  +} else throw new IllegalArgumentException("Child is not a WarpHost");
  +}
  +
  +/**
  + * Find a child WarpHost associated with the specified Host ID.
  + */
  +public WarpHost findChild(int id) {
  +Container children[]=this.findChildren();
  +for (int x=0; xchildren.length; x++) {
  +WarpHost curr=(WarpHost)children[x];
  +if (curr.getHostID()==id) return(curr);
  +}
  +return(null);
  +}
  +
  +// --- BEAN METHODS
  +
  +/**
  + * Return the application root for this Connector. This can be an absolute
  + * pathname, a relative pathname, or a URL.
  + */
  +public String getAppBase() {
  +return (this.appbase);
  +}
  +
  +/**
  + * Set the application root for this Connector. This can be an absolute
  + * pathname, a relative pathname, or a URL.
  + */
  +public void setAppBase(String appbase) {
  +if (appbase==null) return;
  +if (DEBUG) this.debug("Setting application root to "+appbase);
  +String old=this.appbase;
  +this.appbase=appbase;
   }
   
   // -- DEBUGGING METHODS