vmassol     01/06/18 05:53:37

  Modified:    cactus/build build-servletapi.xml build.properties.sample
               cactus/conf/sample/build/servlet22 build.properties.sample
                        build.xml
  Added:       cactus/conf/sample/build/servlet22
                        build-tests-enhydra-31.xml
               cactus/conf/sample/conf/test/servlet22/enhydra31
                        multiserver.conf
               cactus/src/ant/org/apache/commons/cactus/ant EnhydraRun.java
                        PathConvert.java
  Log:
  added Ant script support for Enhydra 3.1 (thanks to Robert Leftwich for contributing 
this feature)
  
  Revision  Changes    Path
  1.12      +10 -1     jakarta-commons/cactus/build/build-servletapi.xml
  
  Index: build-servletapi.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cactus/build/build-servletapi.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- build-servletapi.xml      2001/06/17 18:26:13     1.11
  +++ build-servletapi.xml      2001/06/18 12:53:33     1.12
  @@ -564,6 +564,12 @@
       <target name="tests-functional22-weblogic51-else" unless="weblogic.home.51">
           <property name="weblogic.flag.51" value=""/>
       </target>
  +    <target name="tests-functional22-enhydra31-if" if="enhydra.home.31">
  +        <property name="enhydra.flag.31" 
value="-Denhydra.home.31=${enhydra.home.31}"/>
  +    </target>
  +    <target name="tests-functional22-enhydra31-else" unless="enhydra.home.31">
  +        <property name="enhydra.flag.31" value=""/>
  +    </target>
   
       <target name="tests-functional22-checks"
           depends="tests-functional22-resin12-if,
  @@ -575,7 +581,9 @@
                    tests-functional22-orion14-if,
                    tests-functional22-orion14-else,
                    tests-functional22-weblogic51-if,
  -                 tests-functional22-weblogic51-else">
  +                 tests-functional22-weblogic51-else,
  +                 tests-functional22-enhydra31-if,
  +                 tests-functional22-enhydra31-else">
       </target>
   
       <target name="tests-functional22" depends="sample,tests-functional22-checks">
  @@ -591,6 +599,7 @@
               <arg value="${tomcat.flag.32}"/>
               <arg value="${orion.flag.14}"/>
               <arg value="${weblogic.flag.51}"/>
  +            <arg value="${enhydra.flag.31}"/>
               <arg value="tests_all"/>
   
               <classpath>            
  
  
  
  1.4       +1 -0      jakarta-commons/cactus/build/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cactus/build/build.properties.sample,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.properties.sample   2001/06/17 13:34:33     1.3
  +++ build.properties.sample   2001/06/18 12:53:33     1.4
  @@ -40,3 +40,4 @@
   resin.home.20 = f:/applis/resin-2.0.0
   resin.home.13 = f:/applis/resin-1.3.s010125
   tomcat.home.40 = f:/applis/jakarta-tomcat-4.0-b1
  +#enhydra.home.31 = xxx
  \ No newline at end of file
  
  
  
  1.4       +1 -0      
jakarta-commons/cactus/conf/sample/build/servlet22/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/cactus/conf/sample/build/servlet22/build.properties.sample,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.properties.sample   2001/06/17 13:33:28     1.3
  +++ build.properties.sample   2001/06/18 12:53:34     1.4
  @@ -19,3 +19,4 @@
   tomcat.home.32 = f:/applis/jakarta-tomcat-3.2.1
   orion.home.14 = f:/applis/orion-1.4.5
   weblogic.home.51 = e:/weblogic
  +#enhydra.home.31 =
  \ No newline at end of file
  
  
  
  1.2       +4 -1      jakarta-commons/cactus/conf/sample/build/servlet22/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cactus/conf/sample/build/servlet22/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.xml 2001/06/17 17:17:29     1.1
  +++ build.xml 2001/06/18 12:53:34     1.2
  @@ -7,6 +7,7 @@
       <!ENTITY build-tests-orion-14 SYSTEM "file:./build-tests-orion-14.xml">
       <!ENTITY build-tests-tomcat-32 SYSTEM "file:./build-tests-tomcat-32.xml">
       <!ENTITY build-tests-weblogic-51 SYSTEM "file:./build-tests-weblogic-51.xml">
  +    <!ENTITY build-tests-enhydra-31 SYSTEM "file:./build-tests-enhydra-31.xml">
   ]>
   
   <!-- 
  @@ -78,6 +79,7 @@
           <echo message=" tests_tomcat_32   --> run tests for Tomcat 3.2"/>
           <echo message=" tests_weblogic_51 --> run tests for WebLogic 5.1"/>
           <echo message=" tests_orion_14    --> run tests for Orion 1.4"/>
  +        <echo message=" tests_enhydra_31  --> run tests for Enhydra 3.1"/>
           <echo message=""/>
   
       </target>
  @@ -88,7 +90,7 @@
          ========================================================================
       -->
       <target name="tests_all"
  -        
depends="tests_resin_20,tests_resin_12,tests_tomcat_32,tests_orion_14,tests_weblogic_51">
  +        
depends="tests_resin_20,tests_resin_12,tests_tomcat_32,tests_orion_14,tests_weblogic_51,tests_enhydra_31">
       </target>
   
       &build-tests-resin-20;
  @@ -96,5 +98,6 @@
       &build-tests-orion-14;
       &build-tests-tomcat-32;
       &build-tests-weblogic-51;
  +    &build-tests-enhydra-31;
   
   </project>
  
  
  
  1.1                  
jakarta-commons/cactus/conf/sample/build/servlet22/build-tests-enhydra-31.xml
  
  Index: build-tests-enhydra-31.xml
  ===================================================================
      <!--
         ========================================================================
           Run Enhydra 3.1 tests
         ========================================================================
      -->
      <target name="tests_enhydra_31" depends="prepare_tests_enhydra_31" 
if="enhydra.home.31">
  
          <!-- Start the servlet engine, wait for it to be started, run the
               unit tests, stop the servlet engine, wait for it to be stopped.
               The servlet engine is stopped if the tests fail for any reason -->
  
          <runservertests testURL="http://localhost:8080/test";
              startTarget="start_enhydra_31"
              stopTarget="stop_enhydra_31"
              testTarget="tests"/>
  
      </target>
  
      <!--
         ========================================================================
           Start Enhydra 3.1
         ========================================================================
      -->
      <target name="start_enhydra_31">
  
          <java classname="org.apache.commons.cactus.ant.EnhydraRun" fork="yes">
              <arg value="-start"/>
              <arg value="${out.enhydra31.dir}/conf/multiserver.conf"/>
              <classpath>
                  <fileset dir="${enhydra.home.31}/lib">
                      <include name="enhydra.jar"/>
                      <include name="admin.jar"/>
                  </fileset>
                  <pathelement location="${cactus.ant.jar}"/>
                  <pathelement location="${java.home}/../lib/tools.jar"/>
              </classpath>
          </java>
  
      </target>
  
      <!--
         ========================================================================
           Stop Enhydra 3.1
         ========================================================================
      -->
      <target name="stop_enhydra_31">
  
          <java classname="org.apache.commons.cactus.ant.EnhydraRun" fork="yes">
              <arg value="-stop"/>
              <classpath>
                  <fileset dir="${enhydra.home.31}/lib">
                      <include name="enhydra.jar"/>
                      <include name="admin.jar"/>
                  </fileset>
                  <pathelement location="${cactus.ant.jar}"/>
                  <pathelement location="${java.home}/../lib/tools.jar"/>
              </classpath>
          </java>
  
      </target>
  
      <!--
         ========================================================================
           Display a warning message if the needed servlet engine home property
           is not set
         ========================================================================
      -->
      <target name="check_tests_enhydra_31" depends="testwar" unless="enhydra.home.31">
  
          <echo message=""/>
          <echo message="*********************************************************"/>
          <echo message="WARNING : The 'enhydra.home.31' property has not been set."/>
          <echo message="          No test will be run on that servlet engine."/>
          <echo message="*********************************************************"/>
          <echo message=""/>
  
      </target>
  
      <!--
         ========================================================================
           Prepare directories and variables for running the tests
         ========================================================================
      -->
      <target name="prepare_tests_enhydra_31" depends="check_tests_enhydra_31" 
if="enhydra.home.31">
  
          <taskdef name="pathconvert" 
classname="org.apache.commons.cactus.ant.PathConvert">
              <classpath>
                  <pathelement location="${cactus.ant.jar}"/>
              </classpath>
          </taskdef>
  
          <echo message="enhydra.home.31 = ${enhydra.home.31}"/>
  
          <property name="out.enhydra31.dir" value="${out.test.dir}/enhydra31"/>
          <property name="conf.enhydra31.dir" value="${conf.test.dir}/enhydra31"/>
  
          <pathconvert targetos="unix" property="full.out.enhydra31.dir" >
              <path>
                  <pathelement location="${basedir}/${out.enhydra31.dir}"/>
              </path>
          </pathconvert>
  
          <echo message="full.out.enhydra31.dir = ${full.out.enhydra31.dir}"/>
          <filter token="out.enhydra31.dir" value="${out.enhydra31.dir}"/>
          <filter token="full.out.enhydra31.dir" value="${full.out.enhydra31.dir}"/>
  
          <!-- Create work and conf directories and copy configuration files -->
          <mkdir dir="${out.enhydra31.dir}/conf"/>
          <mkdir dir="${out.enhydra31.dir}/work"/>
          <mkdir dir="${out.enhydra31.dir}/webapps"/>
  
          <!-- Copy the configuration file -->
          <copy file="${conf.enhydra31.dir}/multiserver.conf"
              tofile="${out.enhydra31.dir}/conf/multiserver.conf" filtering="on"/>
  
          <!-- This is needed here because Enhydra 3.1 does not support
               automatic war deployment  -->
          <unwar src="${out.test.dir}/test.war"
              dest="${out.enhydra31.dir}/webapps/"/>
  
      </target>
  
  
  
  1.1                  
jakarta-commons/cactus/conf/sample/conf/test/servlet22/enhydra31/multiserver.conf
  
  Index: multiserver.conf
  ===================================================================
  # Enhydra Multiserver Config File
  # ==================================
  # This file contains the configuration options for the
  # Enhydra Multiserver. Typically it is manipulated
  # through the Multiserver Admin application, however,
  # power users may wish to edit it by hand.
  #
  # Notes:
  #  * The Multiserver only reads this file on startup.
  #    It is thus necessary to stop and restart the server if
  #    changes are made by hand.
  #  * The order of the parameters in this file is not significant.
  #  * Quotes are not required to delimit strings but are advised.
  #  * Array parameters are specified as a comma separated list.
  #    The parameter name is identified as an array with a "[]"
  #    suffix.
  #
  
  
  
  # Server Section -----------------------------------------------------
  # ==============
  # These options configure server-wide attributes.
  #
  # Server.ConfDir
  # --------------
  # This is where the application's config files are stored.
  # Each Enhydra application has a configuration
  # file that must be placed in this directory in order for the
  # application to be visible by the Multiserver and the Multiserver
  # admin application.
  #
  # Server.LogFile
  # --------------
  # This is the file where the server log is written.
  #
  # Server.LogToFile[]
  # ------------------
  # This is a comma separated list of message types to send to the log
  # file specified in server.logFile.
  #
  # Server.LogToStderr[]
  # --------------------
  # This is a comma separated list of message types to send to standard error.
  #
  # Possible logger levels:
  # -----------------------
  # These levels will be familiar to anyone that has used the UNIX
  # syslog functionality:
  #
  #   EMERGENCY
  #     Panic condition.
  #   ALERT
  #     A condition that should be corrected immediately, such as
  #     database corruption.
  #   CRITICAL
  #     Critical conditions such as had device errors.
  #   ERROR
  #     General errors that are not usually fatal, but must be
  #     resolved.
  #   WARNING
  #     Warning condition that may need attention, although the
  #     need is not immediate.
  #   NOTICE
  #     Conditions that are not error conditions, but may require
  #     special handling such as infrequent conditions.
  #   INFO
  #     General informational conditions, knowledge of which will
  #     help to keep the server in good order.
  #   DEBUG
  #     Messages that contain information normally of use only when
  #     debugging an application.
  #   CLASSLOAD
  #       Information about the loading of application classes.  Very
  #       useful debugging class path problems.
  #   REQUEST
  #       The StandardLoggingFilter logs hits to this facility if
  #       this is specified (normally it writes to it's own file).
  #   XMLC
  #       Information about auto-compiling XMLC pages.
  #   XMLC_DEBUG
  #       Debug information about auto-compiling XMLC pages.
  #
  #
  Server.ConfDir = "@out.enhydra31.dir@/conf"
  Server.LogFile = "@out.enhydra31.dir@/logs/multiserver.log"
  Server.LogToFile[] = EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, INFO
  Server.LogToStderr[] = EMERGENCY
  #
  # The above setting is for verbose output. When running as a daemon
  # process you may want to print out only emergencies, for example:
  #     Server.LogToStderr[] = EMERGENCY
  #
  
  
  # Enhydra Application Section -----------------------------------------
  # ==========================
  # Each Enhydra application is added to the Multiserver with the
  # following syntax. Note that multiple applications can be
  # defined, the only restriction is that the <APPLICATION_ID> must
  # be unique.
  #
  # Application.<APPLICATION_ID>.ConfFile
  # -------------------------------------
  # This is set to "filename.conf", which must exist in the directory
  # defined by "Server.ConfDir".
  #
  # Application.<APPLICATION_ID>.Description
  # ----------------------------------------
  # A description of the application. This is visible in the
  # management console.
  #
  # Application.<APPLICATION_ID>.Running = yes | no
  # -----------------------------------------------
  # This is basically the same as the start/stop buttons in the admin
  # app. If the server has running = no, then it will not be instantiated,
  # until the user of the admin app clicks on the "start" button.
  #
  
  # Servlet Section ----------------------------------------------------
  # ===============
  # The Multiserver is able to run standard servlets in addition to
  # Enhydra applications. The following syntax is
  # used to define a servlet. Note that multiple servlets
  # can be defined, the only restriction is that the <SERVLET_ID>
  # must be unique.
  #
  # Each servlet is defined with:
  #
  # Servlet.<SERVLET_ID>.ClassName = entryClass
  # Servlet.<SERVLET_ID>.DocRoot = Document root for servlet.
  # Servlet.<SERVLET_ID>.Description = "A description of servlet"
  # Servlet.<SERVLET_ID>.Running = yes | no
  #
  # where the ".classname" parameter defines the class with the
  # service() method and ".description" defines a description used
  # by the admin tool. The ".docRoot" is the full path to the
  # directory used as the document root for this servlet and
  # ".running" indicated whether to automatically start the
  # servlet when the Multiserver is started.
  #
  # Optionally a servlet can be further specified with the following
  # options:
  #
  # Servlet.<SERVLET_ID>.InitArgs
  # -----------------------------
  # This is a collection of name-value pairs that are passed to the
  # servlet and initial arguments. Refer to the servlet documentation
  # for more information.
  # For example:
  #     Servlet.<SERVLET_ID>.InitArgs.LogFile = /tmp/log
  #     Servlet.<SERVLET_ID>.InitArgs.Max = 256
  #     Servlet.<SERVLET_ID>.InitArgs.Names[] = "Joe Bob", "Jane Bee"
  #
  # Servlet.<SERVLET_ID>.ClassPath[]
  # --------------------------------
  # This is set to a comma-separated list of classpath elements. The
  # class loader will be extended with these paths so that the
  # servlet can successfully load any required classes.
  #
  # Application.<APPLICATION_ID>.Running
  # ------------------------------------
  # This is basically the same as the start/stop buttons in the admin
  # app. If the server has running = no, then it will not be instantiated,
  # until the user of the admin app clicks on the "start" button.
  #
  
  #
  # Example:
  #    This shows all the data about the request available via the
  #    servlet api. It is useful for debugging and testing.
  #
  #Servlet.SnoopServlet.ClassName = org.enhydra.servlet.tests.SnoopServlet
  #Servlet.SnoopServlet.DocRoot = /tmp
  #Servlet.SnoopServlet.Description = "The snoop servlet."
  #Servlet.SnoopServlet.ClassPath[] = "out/test/enhydra31/lib/snoop.jar"
  #Servlet.SnoopServlet.Running = no
  #
  # Example:
  #   This servlet execs cgi-bin programs, e.g. Perl scripts.
  #   Be sure to edit DocRoot to point to the directory containing your
  #   scripts and/or programs.
  # Note that an alternative mechanism for executing cgi scripts based on
  # file extension rather than directory exists in the FileServerServlet.
  #
  #Servlet.CGIRunner.ClassName = org.enhydra.servlet.servlets.CGIServlet
  #Servlet.CGIRunner.DocRoot = /usr/local/htdocs/cgi-bin
  #Servlet.CGIRunner.Description = "Execs cgi-bin programs."
  #Servlet.CGIRunner.Running = yes
  #
  # To use these examples, uncomment them and re-run the Multiserver.
  # Then go to the admin application, select them, and add connections to
  # whatever port and url-prefix (e.g. / or /name/) you wish.
  # When the server is running the way you like it, remember to save your
  # changes by clicking on the "Save State" button.
  #
  
  
  
  # WebApp Section ----------------------------------------------------
  # ===============
  # The Multiserver is able to run Servlet 2.2 Web Applications.
  # The following syntax is used to define a webapp.
  #
  # Each webapp is defined with:
  #
  # Application.<APP_ID>.DocRoot = Document root for webapp.
  # Application.<APP_ID>.Description = "A description of webapp"
  # Application.<APP_ID>.Running = yes | no
  #
  # where the ".classname" parameter defines the class with the
  # service() method and ".description" defines a description used
  # by the admin tool. The ".docRoot" is the full path to the
  # directory used as the document root for this servlet and
  # ".running" indicated whether to automatically start the
  # servlet when the Multiserver is started.
  #
  # Optional parameters include the following:
  #
  # Application.<APP_ID>.defaultSessionTimeOut = 30
  # Application.<APP_ID>.isInvokerEnabled = true
  # Application.<APP_ID>.isWARExpanded = false
  # Application.<APP_ID>.isWARValidated = false
  # Application.<APP_ID>.isWorkDirPersistent = false
  #
  
  
  
  # Connection Methods Section -----------------------------------------
  # ==========================
  # This section defines all the possible ways that the Multiserver will
  # accept requests. Any number of connection methods are allowable
  # so long as the <CONNECTION_ID> is unique. The <CONNECTION_ID>
  # is used when associated with an application/servlet by defining
  # a channel.
  #
  # Connection.<CONNECTION_ID>.Type
  # -------------------------------
  # The connection type is set to any supported connection method.
  # Possible types are:
  #
  # "http"
  # This instructs the Multiserver to directly listen for http requests on the
  # specified port. The port is specified with:
  #     Connection.<CONNECTION_ID>.Port = <port>
  # The number of handler threads my be specified with:
  #       Connection.<CONNECTION_ID>.NumThreads = <num>   (optional)
  # The number of socket requests to queue (after accept, before processing)
  # may be specified with:
  #       Connection.<CONNECTION_ID>.QueueSize = <num>    (optional)
  # The idle timeout period for a client connection, in seconds.  This is the
  # amount of time to block without activity.
  #       Connection.<CONNECTION_ID>.ClientTimeout = <num>   (optional)
  # The idle timeout period for a handler thread, in seconds.  Shorter timeouts
  # minimize the number of threads (memory) while slowing response time for
  # bursts of activity.
  #       Connection.<CONNECTION_ID>.ThreadTimeout = <num>   (optional)
  #
  # "https"
  # This instructs the Multiserver to directly listen for secure-http requests
  # on the specified port. The port is specified with:
  #     Connection.<CONNECTION_ID>.Port = <port>
  # The number of handler threads my be specified with:
  #       Connection.<CONNECTION_ID>.NumThreads = <num>   (optional)
  # The number of socket requests to queue (after accept, before processing)
  # may be specified with:
  #       Connection.<CONNECTION_ID>.QueueSize = <num>    (optional)
  #
  
  
  # Channel Section ----------------------------------------------------
  # ===============
  # This section defines how applications/servlets are connected with
  # connection methods. Each channel entry represents an entry point
  # to an application than can be individually controlled. Note that
  # like other IDs, each <CHANNEL_ID> must by unique.
  #
  # Each channel is defined with:
  #
  # Channel.<CONNECTION_ID>.<CHANNEL_ID>.Servlet = <APPLICATION_ID>
  #    or
  # Channel.<CONNECTION_ID>.<CHANNEL_ID>.Servlet = <SERVLET_ID>
  #
  #    and
  # Channel.<CONNECTION_ID>.<CHANNEL_ID>.Url = <url prefix>
  #    and
  # Channel.<CONNECTION_ID>.<CHANNEL_ID>.Filters = <FILTER_ID>,<FILTER_ID>
  #    and
  # Channel.<CONNECTION_ID>.<CHANNEL_ID>.Enabled = yes | no
  #
  #
  # where the ".Servlet" parameter defines the application/servlet
  # to connect to and the <CONNECTION_ID>.<CHANNEL_ID> path defines
  # the connection method to connect to.
  # The Url should generally begin and end with a '/'.
  # The ".Filters" is optional and defines a
  # list of <FILTER_ID> that a channel is subject to. Filters are
  # executed in the order that they are defined. The most common use
  # of a filter is for logging purposes. In general, filters are an
  # advanced topic that is discussed in the developers guide.
  
  
  
  # Filter Section -----------------------------------------------------
  # ==============
  # This section is allows filters to be defined and subsequently used
  # on a channel declaration. Note that each <FILTER_ID> must be unique.
  #
  # WARNING: It is the responsability of the administrator to ensure that
  # the CLASPATH is set up prior to running the Multiserver such that the filter
  # (and any classes it needs) will be found. The location of the filter
  # class on disk is not specified.
  #
  # Each filter is defined with:
  #
  # Filter.<FILTER_ID>.ClassName = entryClass
  # Filter.<FILTER_ID>.Description = "A description of filter"
  #
  # where the ".classname" parameter defines the class with the
  # service() method and ".description" defines a description used
  # by the admin tool.
  #
  # Optionally a filter can be further specified with the following option:
  #
  # Filter.<FILTER_ID>.InitArgs
  # -----------------------
  # This is a collection of name-value pairs that are passed to the
  # servlet and initial arguments. Refer to the developers guide
  # for more information.
  # For example:
  #     Filter.<FILTER_ID>.InitArgs.configFile = /tmp/filter_config
  #     Filter.<FILTER_ID>.InitArgs.myParam = myValue
  #
  
  
  #
  # This filter is used to log the requests as they are made to the server
  # (aka "hits"). If the key REQUEST is present in Server.LogToFile or
  # Server.LogToStderr (above), then a simple summary of the request and
  # response will be sent to the standard logging facility. This kind of
  # logging is usefull for quick debugging of an application. If the key
  # REQUEST is not present, then data is not sent to the standard logging
  # facility.
  # If the initial argument "logFile" (optional, below) is set, then this filter
  # will append data about the requests to the specified file, in a standard
  # format that tools like Web Analyzer can read. If no logFile is specified,
  # then data is not written to the file.
  # This filter is applied to individual channels, so only the channels
  # that need logging pay the overhead.
  #
  Filter.StandardLogger.ClassName = org.enhydra.servlet.filter.StandardLoggingFilter
  Filter.StandardLogger.Description = "Standard Enhydra Logging."
  Filter.StandardLogger.InitArgs.logFile = "@out.enhydra31.dir@/logs/access.log"
  
  Channel.CM_0.channel_0.Enabled = yes
  Channel.CM_0.channel_0.Servlet = CactusSample
  Channel.CM_0.channel_0.Url = "/test"
  
  Application.CactusSample.Running = yes
  Application.CactusSample.isInvokerEnabled = true
  Application.CactusSample.isWARValidated = true
  Application.CactusSample.DocRoot = "@full.out.enhydra31.dir@/webapps"
  Application.CactusSample.isWARExpanded = true
  Application.CactusSample.Description =
  Application.CactusSample.isWorkDirPersistent = false
  Application.CactusSample.defaultSessionTimeOut = -1
  
  Connection.CM_0.ThreadTimeout = 300
  Connection.CM_0.ClientTimeout = 30
  Connection.CM_0.NumThreads = 200
  Connection.CM_0.Type = http
  Connection.CM_0.QueueSize = 400
  Connection.CM_0.Port = 8080
  
  
  
  1.1                  
jakarta-commons/cactus/src/ant/org/apache/commons/cactus/ant/EnhydraRun.java
  
  Index: EnhydraRun.java
  ===================================================================
  /*
   * 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", "Ant", 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 [EMAIL PROTECTED]
   *
   * 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/>.
   */
  package org.apache.commons.cactus.ant;
  
  import java.net.*;
  import java.io.*;
  import java.util.*;
  import java.lang.reflect.*;
  
  /**
   * Starts/stop Enhydra by setting up a listener socket.
   */
  public class EnhydraRun extends AbstractServerRun
  {
        private Object m_Server;
  
        public static void main(String[] args)
        {
                AbstractServerRun.doRun( new EnhydraRun(), args );
        }
  
        // function to actually start an Enhydra server
        protected void doStartServer(String[] args) throws Exception {
                Class enhydraClass = 
Class.forName("com.lutris.multiServer.MultiServer");
                Method initMethod = enhydraClass.getMethod("main", new Class[] { 
args.getClass() });
                initMethod.invoke(null, new Object[] { args } );
        }
  
        // function to actually stop an Enhydra server
        protected void doStopServer() throws Exception {
                Class enhydraClass = 
Class.forName("com.lutris.multiServer.MultiServer");
                Method shutDownMethod = enhydraClass.getMethod("shutdown", null);
                shutDownMethod.invoke(null, null );
        }
  
  }
  
  
  1.1                  
jakarta-commons/cactus/src/ant/org/apache/commons/cactus/ant/PathConvert.java
  
  Index: PathConvert.java
  ===================================================================
  /*
   * 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", "Ant", 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 [EMAIL PROTECTED]
   *
   * 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/>.
   */
  
  package org.apache.commons.cactus.ant;
  
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.Project;
  import org.apache.tools.ant.Task;
  import org.apache.tools.ant.types.*;
  
  import java.util.*;
  
  /**
   * This task converts path and classpath information to a specific target OS format.
   * The resulting formatted path is placed into a specified property.
   * <p>
   * LIMITATION: Currently this implementation groups all machines into one of two
   * types: Unix or Windows.  Unix is defined as NOT windows.
   *
   * @author Larry Streepy <a 
href="mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]</a>
   */
  public class PathConvert extends Task {
  
      /**
       * Helper class, holds the nested <map> values.  Elements will look like this:
       * &lt;map from="d:" to="/foo"/>
       * <p>
       * When running on windows, the prefix comparison will be case insensitive.
       */
      public class MapEntry {
  
          /**
           * Set the "from" attribute of the map entry
           */
          public void setFrom( String from ) {
              this.from = from;
          }
  
          /**
           * Set the "to" attribute of the map entry
           */
          public void setTo( String to ) {
              this.to = to;
          }
  
          /**
           * Apply this map entry to a given path element
           * @param elem Path element to process
           * @return String Updated path element after mapping
           */
          public String apply( String elem ) {
              if( from == null || to == null ) {
                  throw new BuildException( "Both 'from' and 'to' must be set in a map 
entry" );
              }
  
              // If we're on windows, then do the comparison ignoring case
              String cmpElem = onWindows ? elem.toLowerCase() : elem;
              String cmpFrom = onWindows ? from.toLowerCase() : from;
  
              // If the element starts with the configured prefix, then convert the 
prefix
              // to the configured 'to' value.
  
              if( cmpElem.startsWith( cmpFrom ) ) {
                  int len = from.length();
  
                  if( len >= elem.length() ) {
                      elem = to;
                  } else {
                      elem = to + elem.substring( len );
                  }
              }
  
              return elem;
          }
  
          // Members
          private String from = null;
          private String to = null;
      }
  
      /**
       * Create a nested PATH element
       */
      public Path createPath() {
  
          if( isReference() )
              throw noChildrenAllowed();
  
          if( path == null ) {
              path = new Path(getProject());
          }
          return path.createPath();
      }
  
      /**
       * Create a nested MAP element
       */
      public MapEntry createMap() {
  
          MapEntry entry = new MapEntry();
          prefixMap.add( entry );
          return entry;
      }
  
      /**
       * Set the value of the targetos attribute
       */
      public void setTargetos( String target ) {
  
          targetOS = target.toLowerCase();
  
          if( ! targetOS.equals( "windows" ) && ! target.equals( "unix" ) ) {
              throw new BuildException( "targetos must be one of 'unix' or 'windows'" 
);
          }
  
          // Currently, we deal with only two path formats: Unix and Windows
          // And Unix is everything that is not Windows
  
          targetWindows = targetOS.equals("windows");
      }
  
      /**
       * Set the value of the proprty attribute - this is the property into which our
       * converted path will be placed.
       */
      public void setProperty( String p ) {
          property = p;
      }
  
      /**
       * Adds a reference to a PATH defined elsewhere.
       */
      public void setPathRef(Reference r) {
          if( path != null )
              throw noChildrenAllowed();
  
          pathref = r;
      }
  
      /**
       * Has the pathref attribute of this element been set?
       */
      public boolean isReference() {
          return pathref != null;
      }
  
      /**
       * Do the execution.
       */
      public void execute() throws BuildException {
  
          // If we are a reference, the create a Path from the reference
          if( isReference() ) {
              path = new Path(getProject()).createPath();
              path.setRefid(pathref);
          }
  
          validateSetup();                    // validate our setup
  
          // Currently, we deal with only two path formats: Unix and Windows
          // And Unix is everything that is not Windows
  
          String osname = System.getProperty("os.name").toLowerCase();
          onWindows = ( osname.indexOf("windows") >= 0 );
  
          StringBuffer rslt = new StringBuffer( 100 );
  
          // If we're on the same platform type as the target, then there is no
          // conversion work to do.
  
          if( onWindows != targetWindows ) {
  
              char pathSep = targetWindows ? ';' : ':';
  
              // Get the list of path components in canonical form
              String[] elems = path.list();
  
              for( int i=0; i < elems.length; i++ ) {
                  String elem = elems[i];
  
                  elem = mapElement( elem );      // Apply the path prefix map
  
                  // Now convert the path and file separator characters from the
                  // current os to the target os.
  
                  if( targetWindows ) {
                      elem = elem.replace( '/', '\\' );
                  } else {
                      elem = elem.replace( '\\', '/' );
                  }
  
                  if( i != 0 ) rslt.append( pathSep );
                  rslt.append( elem );
              }
  
          } else {
              rslt.append( path.toString() );     // No additional work to do
          }
  
          // Place the result into the specified property
          String value = rslt.toString();
  
          log( "Set property " + property + " = " + value, Project.MSG_VERBOSE );
  
          getProject().setProperty( property, value );
      }
  
      /**
       * Apply the configured map to a path element.  The map is used to convert
       * between Windows drive letters and Unix paths.  If no map is configured,
       * the default operation is:
       * <UL>
       * <LI>when target is unix: remove all drive letters</LI>
       * <LI>when target is windows: add "C:"
       * </UL>
       *
       * @param elem The path element to apply the map to
       * @return String Updated element
       */
      private String mapElement( String elem ) {
  
          int size = prefixMap.size();
  
          if( size == 0 ) {
  
              if( targetWindows ) {
                  elem = "C:" + elem;
              } else {
                  // If the element starts with a drive letter, remove it
                  if( elem.charAt(1) == ':' )
                      elem = elem.substring(2);
              }
  
          } else {
              // Iterate over the map entries and apply each one.  Stop when one of the
              // entries actually changes the element
  
              for( int i=0; i < size; i++ ) {
                  MapEntry entry = (MapEntry)prefixMap.get(i);
                  String newElem = entry.apply( elem );
  
                  // Note I'm using "!=" to see if we got a new object back from
                  // the apply method.
  
                  if( newElem != elem ) {
                      elem = newElem;
                      break;                  // We applied one, so we're done
                  }
              }
          }
  
          return elem;
      }
  
      /**
       * Validate that all our parameters have been properly initialized.
       * @throws BuildException if something is not setup properly
       */
      private void validateSetup() throws BuildException {
  
          if( path == null )
              throw new BuildException( "You must specify a path to convert" );
  
          if( targetOS == null )
              throw new BuildException( "You must specify a target OS" );
  
          if( property == null )
              throw new BuildException( "You must specify a property" );
      }
  
      /**
       * Creates an exception that indicates that this XML element must
       * not have child elements if the pathrefid attribute is set.
       */
      private BuildException noChildrenAllowed() {
          return new BuildException("You must not specify nested PATH elements when 
using pathref");
      }
  
  
      // Members
      private Path path = null;               // Path to be converted
      private Reference pathref = null;       // Reference to path to convert
      private String targetOS = null;         // The target OS type
      private boolean targetWindows = false;  // Set when targetOS is set
      private boolean onWindows = false;      // Set if we're running on windows
      private String property = null;         // The property to receive the results
      private ArrayList prefixMap = new ArrayList();  // Path prefix map
  }
  
  
  
  

Reply via email to