costin      02/05/06 14:38:22

  Modified:    src/share/org/apache/tomcat/startup EmbededTomcat.java
  Log:
  Allow 'mini' to start with a configurable port.
  
  ( I use this to play with my Zaurus, and to get tomcat started in
  the smallest amount of time - that's about 2 secs )
  
  Revision  Changes    Path
  1.65      +24 -3     
jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java
  
  Index: EmbededTomcat.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- EmbededTomcat.java        24 Feb 2002 03:39:58 -0000      1.64
  +++ EmbededTomcat.java        6 May 2002 21:38:22 -0000       1.65
  @@ -132,6 +132,9 @@
   
       String home=null;
       String installDir=null;
  +
  +    int httpPort=8080;
  +    int ajpPort=0;
       
       Hashtable attributes=new Hashtable();
       
  @@ -241,6 +244,20 @@
        serverXml=false;
       }
   
  +    /** Used from estart ( i.e. no server.xml, minimal config )
  +     */
  +    public void setHttpPort( int port ) {
  +        httpPort=port;
  +    }
  +
  +    /** Set the port for ajp connections.
  +     *  If not set, ajp will not be enabled.
  +     *  Used for estart.
  +     */
  +    public void setAjpPort( int port ) {
  +        ajpPort=port;
  +    }
  +    
       /** Dummy, "-run" on the command line.
        */
       public void setRun(boolean b) {
  @@ -670,8 +687,10 @@
       public void addDefaultConnectors()
        throws TomcatException
       {
  -     addEndpoint( 8080, null, null );
  -     addAjpEndpoint( 8007, null, null );
  +        if( httpPort > 0 )
  +            addEndpoint( httpPort, null, null );
  +        if( ajpPort >0 ) 
  +            addAjpEndpoint( ajpPort, null, null );
       }
       
       // -------------------- execute() --------------------
  @@ -1073,13 +1092,15 @@
        out.println("    -config file (or -f file)  Use this file instead of 
server.xml");
           out.println("    -debug level               Sets specified debug level on 
EmbeddedTomcat,");
           out.println("                                   ContextManager, \"Xml\" 
modules, and contexts");
  -        out.println("    -estart                    Starts Tomcat without reading 
server.xml");
           out.println("    -help                      Show this usage report");
        out.println("    -home dir                  Use this directory as 
tomcat.home");
        out.println("    -install dir (or -i dir)   Use this directory as 
tomcat.install");
           out.println("    -jkconf                    Write mod_jk configuration 
files, without");
           out.println("                                   starting Tomcat");
           out.println("    -sandbox                   Enable security manager 
(includes java.policy)");
  +        out.println("    -estart                    Starts Tomcat without reading 
server.xml");
  +        out.println("    -httpPort                  HTTP port to use in 'estart' 
mode");
  +        out.println("    -ajpPort                   AJP port to use in 'estart' 
mode");
           out.println("Note: the '-' on the options is optional.");
           out.println();
       }
  
  
  

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

Reply via email to