You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pi...@apache.org on 2001/07/20 01:36:57 UTC

cvs commit: jakarta-tomcat-connectors/webapp/java WarpConfigurationHandler.java

pier        01/07/19 16:36:57

  Modified:    webapp/java WarpConfigurationHandler.java
  Log:
  Creating WarpContainers instead of standard ones (but the standard ones are
  still allowed)
  
  Revision  Changes    Path
  1.9       +19 -13    jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java
  
  Index: WarpConfigurationHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WarpConfigurationHandler.java	2001/07/19 04:19:01	1.8
  +++ WarpConfigurationHandler.java	2001/07/19 23:36:56	1.9
  @@ -65,6 +65,7 @@
   import org.apache.catalina.Deployer;
   import org.apache.catalina.Host;
   import org.apache.catalina.core.StandardHost;
  +import org.apache.catalina.core.StandardContext;
   
   public class WarpConfigurationHandler {
   
  @@ -76,11 +77,10 @@
           super();
       }
   
  -    public boolean handle(WarpConnection connection)
  +    public boolean handle(WarpConnection connection, WarpPacket packet)
       throws IOException {
           WarpLogger logger=new WarpLogger(this);
           logger.setContainer(connection.getConnector().getContainer());
  -        WarpPacket packet=new WarpPacket();
   
           // Prepare the Welcome packet
           packet.setType(Constants.TYPE_CONF_WELCOME);
  @@ -134,9 +134,6 @@
                   }
   
                   case Constants.TYPE_CONF_DONE: {
  -                    packet.reset();
  -                    packet.setType(Constants.TYPE_CONF_PROCEED);
  -                    connection.send(packet);
                       return(true);
                   }
   
  @@ -145,7 +142,12 @@
                   }
   
                   default: {
  -                    logger.log("Invalid packet with type "+packet.getType());
  +                    String msg="Invalid packet with type "+packet.getType();
  +                    logger.log(msg);
  +                    packet.reset();
  +                    packet.setType(Constants.TYPE_FATAL);
  +                    packet.writeString(msg);
  +                    connection.send(packet);
                       return(false);
                   }
               }
  @@ -162,11 +164,13 @@
   
           Host host=(Host)container.findChild(hostName);
           if (host==null) {
  -            host=new StandardHost();
  -            host.setName(hostName);
  -            host.setParent(container);
  -            host.setAppBase(connection.getConnector().getAppBase());
  -            container.addChild(host);
  +            WarpHost whost=new WarpHost();
  +            whost.setName(hostName);
  +            whost.setParent(container);
  +            whost.setAppBase(connection.getConnector().getAppBase());
  +            whost.setDebug(connection.getConnector().getDebug());
  +            container.addChild(whost);
  +            host=whost;
               if (Constants.DEBUG)
                   logger.debug("Created new host "+host.getName());
           } else if (Constants.DEBUG) {
  @@ -207,8 +211,10 @@
                   logger.debug("Application URL \""+url.toString()+"\"");
   
               deployer.install(applPath, url);
  -            return(deployer.findDeployedApp(applPath));
  -
  +            StandardContext context=null;
  +            context=(StandardContext)deployer.findDeployedApp(applPath);
  +            context.setDebug(connection.getConnector().getDebug());
  +            return(context);
           } else {
               if (Constants.DEBUG)
                   logger.debug("Found application for \""+appl.getName()+"\"");