<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">

<!-- =============================================================== -->
<!-- Configure the Jetty Server                                      -->
<!--                                                                 -->
<!-- Documentation of this file format can be found at:              -->
<!-- http://docs.codehaus.org/display/JETTY/jetty.xml                -->
<!--                                                                 -->
<!-- =============================================================== -->


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

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

    <!-- =========================================================== -->
    <!-- No connectors Set Here.                                     -->
    <!-- See:                                                        -->
    <!--   BIOHttp.xml                                               -->
    <!--   BIOHttps.xml                                              -->
    <!--   NIOHttp.xml                                               -->
    <!--   NIOHttps.xml                                              -->
    <!-- =========================================================== -->

    <!--
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.ServerConnector">
            <Set name="host"><SystemProperty name="jetty.host" /></Set>
            <Set name="port"><SystemProperty name="jetty.port" default="0"/></Set>
            <Set name="idleTimeout">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
          </New>
      </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="WebappContexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
           </Item>
           <Item>
             <New id="vcontexts" class="org.eclipse.jetty.server.handler.ContextHandler">
               <Set name="contextPath">/tests</Set>
               <Set name="VirtualHosts">
                 <Array type="java.lang.String">
                   <Item>VirtualHost</Item>
                 </Array>
               </Set>
               <Set name="ResourceBase"><Property name="test.docroot.base"/>/virtualhost</Set>
               <Set name="Handler"><New id="reshandler" class="org.eclipse.jetty.server.handler.ResourceHandler"/></Set>
               <Set name="DisplayName">virtual</Set>
             </New>
           </Item>
           <Item>
             <New id="defcontext" class="org.eclipse.jetty.server.handler.ContextHandler">
               <Set name="contextPath">/tests</Set>
               <Set name="ResourceBase"><Property name="test.docroot.base"/>/default</Set>
               <Set name="Handler"><New id="reshandler" class="org.eclipse.jetty.server.handler.ResourceHandler"/></Set>
               <Set name="DisplayName">default</Set>
             </New>
           </Item>
           <Item>
             <New id="echocontext" class="org.eclipse.jetty.server.handler.ContextHandler">
               <Set name="contextPath">/echo</Set>
               <Set name="Handler"><New id="echohandler" class="org.eclipse.jetty.test.support.EchoHandler"/></Set>
               <Set name="DisplayName">echo</Set>
             </New>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>

    <Call name="addBean">
      <Arg>
        <New class="org.eclipse.jetty.deploy.ContextDeployer">
          <Set name="contexts"><Ref refid="WebappContexts"/></Set>
          <Set name="configurationDir"><Property name="test.resourcesdir" default="src/test/resources"/>/webapp-contexts/RFC2616</Set>
          <Set name="scanInterval">0</Set>
          <Set name="configurationManager">
            <New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager">
              <Set name="file"><Property name="test.targetdir" default="target"/>/testable-jetty-server-config.properties</Set>
            </New>
          </Set>
        </New>
      </Arg>
    </Call>

    <!-- =========================================================== -->
    <!-- Configure the webapp deployer.                              -->
    <!-- A webapp  deployer will deploy standard webapps discovered  -->
    <!-- in a directory at startup, without the need for additional  -->
    <!-- configuration files.    It does not support hot deploy or   -->
    <!-- non standard contexts (see ContextDeployer above).          -->
    <!--                                                             -->
    <!-- This deployer is configured to deploy webapps from the      -->
    <!-- $JETTY_HOME/webapps directory                               -->
    <!--                                                             -->
    <!-- Normally only one type of deployer need be used.            -->
    <!--                                                             -->
    <!-- =========================================================== -->
    <!--
    <Call name="addBean">
      <Arg>
        <New class="org.eclipse.jetty.deploy.WebAppDeployer">
          <Set name="contexts"><Ref refid="WebappContexts"/></Set>
          <Set name="webAppDir"><Property name="test.targetdir" default="target"/>/webapps</Set>
          <Set name="parentLoaderPriority">false</Set>
          <Set name="extract">true</Set>
          <Set name="allowDuplicates">false</Set>
          <Set name="defaultsDescriptor"><Property name="test.resourcesdir" default="src/test/resources"/>/webdefault.xml</Set>
          <Call name="setAttribute">
            <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
            <Arg>.*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$</Arg>
          </Call>
        </New>
      </Arg>
    </Call>
     -->

    <!-- =========================================================== -->
    <!-- extra options                                               -->
    <!-- =========================================================== -->
    <Set name="stopAtShutdown">true</Set>
    <Set name="stopTimeout">1000</Set>

</Configure>
