<?xml version="1.0"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://jetty.org/configure_10_0.dtd">

<!-- =============================================================== -->
<!-- Configure the test-jndi webapp                                  -->
<!-- =============================================================== -->
<Configure id="wac" class="org.eclipse.jetty.ee9.webapp.WebAppContext">

  <New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction">
    <Arg><Property name="environment" default="ee9"/></Arg>
    <Arg>
      <New class="org.example.MockUserTransaction" />
    </Arg>
  </New>

  <Set name="contextPath">/ee9-test-jndi</Set>
  <Set name="war"><Property name="jetty.webapps" default="." />/ee9-demo-jndi.war
  </Set>
  <Set name="extractWAR">true</Set>
  <Set name="copyWebDir">false</Set>
  <Set name="configurationDiscovered">true</Set>

  <!-- Define an env entry with ee9  scope for java:comp/env                   -->
  <New id="woggle" class="org.eclipse.jetty.plus.jndi.EnvEntry">
    <Arg>
      <Property name="environment" default="ee9"/>
    </Arg>
    <Arg>woggle</Arg>
    <Arg type="java.lang.Integer">4000</Arg>
    <Arg type="boolean">false</Arg>
  </New>

  <!-- Define an env entry with webapp scope for java:comp/env                   -->
  <New id="wiggle" class="org.eclipse.jetty.plus.jndi.EnvEntry">
    <Arg>
      <Ref refid="wac" />
    </Arg>
    <Arg>wiggle</Arg>
    <Arg type="java.lang.Double">100</Arg>
    <Arg type="boolean">true</Arg>
  </New>

  <!-- Mail Session setup                                          -->
  <New id="xxxmail" class="org.eclipse.jetty.plus.jndi.Resource">
    <Arg>
      <Ref refid="wac" />
    </Arg>
    <Arg>mail/Session</Arg>
    <Arg>
      <New class="org.eclipse.jetty.ee9.jndi.factories.MailSessionReference">
        <Set name="user">CHANGE-ME</Set>
        <Set name="password">CHANGE-ME</Set>
        <Set name="properties">
          <New class="java.util.Properties">
            <Put name="mail.smtp.auth">false</Put> <!-- change to true if you want to authenticate -->
            <Put name="mail.smtp.host">CHANGE-ME</Put>
            <Put name="mail.from">CHANGE-ME</Put>
            <Put name="mail.debug">false</Put>
          </New>
        </Set>
      </New>
    </Arg>
  </New>

  <!-- A mock DataSource                                           -->
  <New id="mydatasource" class="org.eclipse.jetty.plus.jndi.Resource">
    <Arg>
      <Ref refid="wac" />
    </Arg>
    <Arg>jdbc/mydatasource</Arg>
    <Arg>
      <New class="org.example.MockDataSource" />
    </Arg>
  </New>

</Configure>
