<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<!-- =============================================================== -->
<!-- Configure the Jetty Server                                      -->
<!--                                                                 -->
<!-- Documentation of this file format can be found at:              -->
<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax        -->
<!--                                                                 -->
<!-- Additional configuration files are available in $JETTY_HOME/etc -->
<!-- and can be mixed in.  For example:                              -->
<!--   java -jar start.jar etc/jetty-ssl.xml                         -->
<!--                                                                 -->
<!-- See start.ini file for the default configuraton files           -->
<!-- =============================================================== -->


<Configure id="Server" class="org.eclipse.jetty.server.Server">

  <!-- =========================================================== -->
  <!-- Server Thread Pool                                          -->
  <!-- =========================================================== -->
  <Set name="ThreadPool">
    <!-- Default queued blocking threadpool -->
    <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
      <Set name="minThreads">10</Set>
      <Set name="maxThreads">200</Set>
      <Set name="detailedDump">false</Set>
    </New>
  </Set>

  <!-- =========================================================== -->
  <!-- Set connectors                                              -->
  <!-- =========================================================== -->

  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
        <Set name="host">
          <Property name="jetty.host"/>
        </Set>
        <Set name="port">
          <Property name="jetty.port" default="8080"/>
        </Set>
        <Set name="maxIdleTime">300000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="statsOn">false</Set>
        <Set name="confidentialPort">8443</Set>
        <Set name="lowResourcesConnections">20000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
      </New>
    </Arg>
  </Call>

  <!-- =========================================================== -->
  <!-- Jetty lifecycle listener that prints a message to open a    -->
  <!-- browser when the server is started. This is to provide      -->
  <!-- information to newbies so that they know what to do after   -->
  <!-- the server is started.                                      -->
  <!-- =========================================================== -->
  <Call name="addLifeCycleListener">
    <Arg>
      <New class="org.xwiki.tools.jetty.listener.NotifyListener" />
    </Arg>
  </Call>

  <!-- =========================================================== -->
  <!-- Set handler Collection Structure                            -->
  <!-- =========================================================== -->
  <Set name="handler">
    <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
      <Set name="handlers">
        <Array type="org.eclipse.jetty.server.Handler">
          <Item>
            <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
          </Item>
          <Item>
            <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
          </Item>
        </Array>
      </Set>
    </New>
  </Set>

  <!-- =============================================================== -->
  <!-- Create the deployment manager                                   -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- The deplyment manager handles the lifecycle of deploying web    -->
  <!-- applications. Apps are provided by instances of the             -->
  <!-- AppProvider interface.  Typically these are provided by         -->
  <!-- one or more of:                                                 -->
  <!--   jetty-webapps.xml       - monitors webapps for wars and dirs  -->
  <!--   jetty-contexts.xml      - monitors contexts for context xml   -->
  <!--   jetty-templates.xml     - monitors contexts and templates     -->
  <!-- =============================================================== -->
  <Call name="addBean">
    <Arg>
      <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
        <Set name="contexts">
          <Ref id="Contexts"/>
        </Set>
        <Call name="setContextAttribute">
          <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
          <Arg>.*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$</Arg>
        </Call>


        <!-- Add a customize step to the deployment lifecycle -->
        <!-- uncomment and replace DebugBinding with your extended AppLifeCycle.Binding class
        <Call name="insertLifeCycleNode">
          <Arg>deployed</Arg>
          <Arg>starting</Arg>
          <Arg>customise</Arg>
        </Call>
        <Call name="addLifeCycleBinding">
          <Arg>
            <New class="org.eclipse.jetty.deploy.bindings.DebugBinding">
              <Arg>customise</Arg>
            </New>
          </Arg>
        </Call>
        -->

      </New>
    </Arg>
  </Call>

  <!-- =============================================================== -->
  <!-- Add a ContextProvider to the deployment manager                 -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- This scans the webapps directory for war files and directories  -->
  <!-- to deploy.                                                      -->
  <!-- This configuration must be used with jetty-deploy.xml, which    -->
  <!-- creates the deployment manager instance                         -->
  <!-- =============================================================== -->
  <Ref id="DeploymentManager">
    <Call name="addAppProvider">
      <Arg>
        <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
          <Set name="monitoredDirName"><Property name="jetty.home" default="."/>/contexts
          </Set>
          <Set name="scanInterval">1</Set>
        </New>
      </Arg>
    </Call>
  </Ref>

  <!-- =========================================================== -->
  <!-- Configure Request Log                                       --><commit_msg>[Misc] Clean up and added explanations<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<!-- =============================================================== -->
<!-- Configure the Jetty Server                                      -->
<!--                                                                 -->
<!-- Documentation of this file format can be found at:              -->
<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax        -->
<!--                                                                 -->
<!-- Additional configuration files are available in $JETTY_HOME/etc -->
<!-- and can be mixed in.  For example:                              -->
<!--   java -jar start.jar etc/jetty-ssl.xml                         -->
<!--                                                                 -->
<!-- See start.ini file for the default configuraton files           -->
<!-- =============================================================== -->


<Configure id="Server" class="org.eclipse.jetty.server.Server">

  <!-- =========================================================== -->
  <!-- Server Thread Pool                                          -->
  <!-- =========================================================== -->
  <Set name="ThreadPool">
    <!-- Default queued blocking threadpool -->
    <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
      <Set name="minThreads">10</Set>
      <Set name="maxThreads">200</Set>
      <Set name="detailedDump">false</Set>
    </New>
  </Set>

  <!-- =========================================================== -->
  <!-- Set connectors                                              -->
  <!-- =========================================================== -->

  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
        <Set name="host">
          <Property name="jetty.host"/>
        </Set>
        <Set name="port">
          <Property name="jetty.port" default="8080"/>
        </Set>
        <Set name="maxIdleTime">300000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="statsOn">false</Set>
        <Set name="confidentialPort">8443</Set>
        <Set name="lowResourcesConnections">20000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
      </New>
    </Arg>
  </Call>

  <!-- =========================================================== -->
  <!-- Jetty lifecycle listener that prints a message to open a    -->
  <!-- browser when the server is started. This is to provide      -->
  <!-- information to newbies so that they know what to do after   -->
  <!-- the server is started.                                      -->
  <!-- =========================================================== -->
  <Call name="addLifeCycleListener">
    <Arg>
      <New class="org.xwiki.tools.jetty.listener.NotifyListener" />
    </Arg>
  </Call>

  <!-- =========================================================== -->
  <!-- Set handler Collection Structure                            -->
  <!-- =========================================================== -->
  <Set name="handler">
    <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
      <Set name="handlers">
        <Array type="org.eclipse.jetty.server.Handler">
          <Item>
            <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
          </Item>
          <Item>
            <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
          </Item>
        </Array>
      </Set>
    </New>
  </Set>

  <!-- =============================================================== -->
  <!-- Create the deployment manager                                   -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- The deployment manager handles the lifecycle of deploying web   -->
  <!-- applications. Apps are provided by instances of the             -->
  <!-- AppProvider interface.  Typically these are provided by         -->
  <!-- one or more of:                                                 -->
  <!--   jetty-webapps.xml       - monitors webapps for wars and dirs  -->
  <!--   jetty-contexts.xml      - monitors contexts for context xml   -->
  <!--   jetty-templates.xml     - monitors contexts and templates     -->
  <!-- =============================================================== -->
  <Call name="addBean">
    <Arg>
      <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
        <Set name="contexts">
          <Ref id="Contexts"/>
        </Set>
        <!-- Note: We don't need to define a "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern" attribute
             since 1) we don't use tlds and 2) starting with Jetty 8.x, jetty employs a Servlet 3.0 way of finding
             tlds, see http://wiki.eclipse.org/Jetty/Howto/Configure_JSP#Jetty_8.x -->
        <!-- Note: Once we start using Servlet 3.0 we'll need to set the attribute named
             "org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern" to not incur too heavy startup times.
             See http://wiki.eclipse.org/Jetty/Howto/Avoid_slow_deployment.

             Example:

               <Call name="setContextAttribute">
                 <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
                 <Arg>.*/.*myPrefixedJarToScan1-[^/]\.jar$|.*/.*myPrefixedJarToScan2-[^/]\.jar$</Arg>
               </Call>
             -->
      </New>
    </Arg>
  </Call>

  <!-- =============================================================== -->
  <!-- Add a ContextProvider to the deployment manager                 -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- This scans the webapps directory for war files and directories  -->
  <!-- to deploy.                                                      -->
  <!-- This configuration must be used with jetty-deploy.xml, which    -->
  <!-- creates the deployment manager instance                         -->
  <!-- =============================================================== -->
  <Ref id="DeploymentManager">
    <Call name="addAppProvider">
      <Arg>
        <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
          <Set name="monitoredDirName"><Property name="jetty.home" default="."/>/contexts
          </Set>
        </New>
      </Arg>
    </Call>
  </Ref>

  <!-- =========================================================== -->
  <!-- Configure Request Log                                       -->
{'fraction_non_alphanumeric': 0.255559968228753, 'fraction_numerical': 0.0066851998940958435, 'mean_word_length': 1.9515530377026764, 'pattern_counts': {'":': 0, '<': 289, '<?xml version=': 2, '>': 289, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2776429', 'n_tokens_mistral': 3826, 'n_tokens_neox': 3586, 'n_words': 950}