remm        2003/01/28 10:19:39

  Modified:    coyote/src/java/org/apache/coyote/tomcat5 CoyoteAdapter.java
                        CoyoteConnector.java CoyoteRequest.java
  Log:
  - "Use" the new mapper.
  - Since the mapper is not populated, it doesn't do anything.
  
  Revision  Changes    Path
  1.8       +14 -6     
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CoyoteAdapter.java        16 Jan 2003 21:58:14 -0000      1.7
  +++ CoyoteAdapter.java        28 Jan 2003 18:19:38 -0000      1.8
  @@ -77,8 +77,10 @@
   import org.apache.coyote.Request;
   import org.apache.coyote.Response;
   
  +import org.apache.catalina.Context;
   import org.apache.catalina.Globals;
   import org.apache.catalina.Logger;
  +import org.apache.catalina.Wrapper;
   import org.apache.catalina.util.StringManager;
   
   
  @@ -214,7 +216,7 @@
        */
       protected void postParseRequest(Request req, CoyoteRequest request,
                                       Response res, CoyoteResponse response)
  -        throws IOException {
  +        throws Exception {
           // XXX the processor needs to set a correct scheme and port prior to this 
point, 
           // in ajp13 protocols dont make sense to get the port from the connector..
           request.setSecure(req.scheme().equals("https"));
  @@ -249,7 +251,7 @@
   
           // Parse cookies
           parseCookies(req, request);
  -     
  +
           // Set the SSL properties
        if( request.isSecure() ) {
            res.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
  @@ -265,6 +267,12 @@
           if (principal != null) {
               request.setUserPrincipal(new CoyotePrincipal(principal));
           }
  +
  +        // Request mapping
  +        connector.getMapper().map(req.serverName(), req.decodedURI(), 
  +                                  request.getMappingData());
  +        request.setContext((Context) request.getMappingData().context);
  +        request.setWrapper((Wrapper) request.getMappingData().wrapper);
   
       }
   
  
  
  
  1.10      +26 -8     
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteConnector.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CoyoteConnector.java      16 Jan 2003 21:58:14 -0000      1.9
  +++ CoyoteConnector.java      28 Jan 2003 18:19:38 -0000      1.10
  @@ -60,9 +60,17 @@
   
   package org.apache.coyote.tomcat5;
   
  -
   import java.util.Vector;
   
  +import javax.management.ObjectName;
  +import javax.management.MBeanServer;
  +import javax.management.MBeanRegistration;
  +
  +import org.apache.commons.modeler.Registry;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +
  +import org.apache.tomcat.util.http.mapper.Mapper;
   import org.apache.tomcat.util.IntrospectionUtils;
   
   import org.apache.coyote.Adapter;
  @@ -81,12 +89,6 @@
   import org.apache.catalina.net.ServerSocketFactory;
   import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
  -import org.apache.commons.modeler.Registry;
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  -import javax.management.ObjectName;
  -import javax.management.MBeanServer;
  -import javax.management.MBeanRegistration;
   
   
   /**
  @@ -321,6 +323,12 @@
       private Adapter adapter = null;
   
   
  +     /**
  +      * Mapper.
  +      */
  +     private Mapper mapper = new Mapper();
  +
  +
       // ------------------------------------------------------------- Properties
   
   
  @@ -580,6 +588,16 @@
           return (info);
   
       }
  +
  +
  +     /**
  +      * Return the mapper.
  +      */
  +     public Mapper getMapper() {
  +
  +         return (mapper);
  +
  +     }
   
   
       /**
  
  
  
  1.15      +46 -6     
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- CoyoteRequest.java        5 Jan 2003 11:24:22 -0000       1.14
  +++ CoyoteRequest.java        28 Jan 2003 18:19:38 -0000      1.15
  @@ -109,6 +109,7 @@
   import org.apache.catalina.Connector;
   import org.apache.catalina.Context;
   import org.apache.catalina.Globals;
  +import org.apache.catalina.Host;
   import org.apache.catalina.HttpRequest;
   import org.apache.catalina.Logger;
   import org.apache.catalina.Manager;
  @@ -123,6 +124,7 @@
   import org.apache.catalina.util.StringManager;
   import org.apache.catalina.util.StringParser;
   
  +import org.apache.tomcat.util.http.mapper.MappingData;
   import org.apache.tomcat.util.net.SSLSupport;
   
   /**
  @@ -418,6 +420,8 @@
           parameterMap.setLocked(false);
           parameterMap.clear();
   
  +        mappingData.recycle();
  +
           if ((Constants.SECURITY) && (facade != null)) {
               facade.clear();
               facade = null;
  @@ -467,8 +471,9 @@
           this.connector = connector;
       }
   
  +
       /**
  -     * The Context within which this Request is being processed.
  +     * Associated context.
        */
       protected Context context = null;
   
  @@ -479,6 +484,7 @@
           return (this.context);
       }
   
  +
       /**
        * Set the Context within which this Request is being processed.  This
        * must be called as soon as the appropriate Context is identified, because
  @@ -515,6 +521,26 @@
   
   
       /**
  +     * Return the Host within which this Request is being processed.
  +     */
  +    public Host getHost() {
  +        return ((Host) mappingData.host);
  +    }
  +
  +
  +    /**
  +     * Set the Host within which this Request is being processed.  This
  +     * must be called as soon as the appropriate Host is identified, and
  +     * before the Request is passed to a context.
  +     *
  +     * @param host The newly associated Host
  +     */
  +    public void setHost(Host host) {
  +        mappingData.host = host;
  +    }
  +
  +
  +    /**
        * Descriptive information about this Request implementation.
        */
       protected static final String info =
  @@ -531,6 +557,19 @@
   
   
       /**
  +     * Mapping data.
  +     */
  +    protected MappingData mappingData = new MappingData();
  +
  +    /**
  +     * Return mapping data.
  +     */
  +    public MappingData getMappingData() {
  +        return (mappingData);
  +    }
  +
  +
  +    /**
        * The facade associated with this request.
        */
       protected CoyoteRequestFacade facade = null;
  @@ -631,7 +670,7 @@
   
   
       /**
  -     * The Wrapper within which this Request is being processed.
  +     * Associated wrapper.
        */
       protected Wrapper wrapper = null;
   
  @@ -641,6 +680,7 @@
       public Wrapper getWrapper() {
           return (this.wrapper);
       }
  +
   
       /**
        * Set the Wrapper within which this Request is being processed.  This
  
  
  

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

Reply via email to