<?xml version="1.0"  encoding="ISO-8859-1"?> 
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">



<!-- =============================================================== -->
<!-- Configure the JettyPlus Server                                  -->
<!-- =============================================================== -->
<Configure class="org.mortbay.jetty.plus.Server">

  <!-- =============================================================== -->
  <!-- Configure context specific log4j logging                        -->
  <!-- =============================================================== -->
  <!-- Uncomment to enable per-context logging. You will also need to  -->
  <!-- create and register a  ServletContextListener that will clean   -->
  <!-- the repository when the context is stopped, by calling this line-->
  <!-- in the contextDestroyed() method:                               -->
  <!--  org.mortbay.log4j.CRS.remove(Thread.currentThread().getContextClassLoader()) -->
  <!-- 
  <Call class="org.apache.log4j.LogManager" name="setRepositorySelector">
    <Arg><New class="org.mortbay.log4j.CRS"/></Arg>
    <Arg><New class="java.lang.Object"/></Arg>
  </Call>
  -->

  <!-- =============================================================== -->
  <!-- Add a transaction manager and XA datasources                    -->
  <!-- =============================================================== -->
  <Call name="addService">
    <Arg>
      <New class="org.mortbay.jetty.plus.JotmService">
        <Set name="Name">TransactionMgr</Set>
         <!-- set up a pooled XADataSource -->
         <Call name="addDataSource">
             <Arg>jdbc/myDB</Arg>   <!-- client lookup jndi name of datasource  -->
             <!-- set up the datasource -->
             <Arg>
               <!-- Uncomment one of the following types of XADataSource        -->
               <!-- according to your type of database:                         -->
               <!-- New class="org.enhydra.jdbc.sybase.SybaseXADataSource"      -->
               <!-- New class="org.enhydra.jdbc.informix.InformixXADataSource"  -->
               <!-- New class="org.enhydra.jdbc.oracle.OracleXADataSource"      -->
               <New class="org.enhydra.jdbc.standard.StandardXADataSource">
                 <Set name="DriverName">org.hsqldb.jdbcDriver</Set>
                 <Set name="Url">jdbc:hsqldb:extra/etc/tmtest</Set>
                 <Set name="User">sa</Set>
                 <Set name="Password"></Set>
                 <!-- Uncomment to setup isolation level as required            -->
                 <!--
                 <Set name="TransactionIsolation"><Get class="java.sql.Connection" name="TRANSACTION_SERIALIZABLE"/></Set> 
                 -->
               </New>
             </Arg>
             <!-- set up a pool for the datasource -->
             <Arg>
               <New class="org.enhydra.jdbc.pool.StandardXAPoolDataSource">
                 <Arg type="Integer">4</Arg>          <!-- initial size of pool -->                
                 <Set name="MinSize">1</Set>                
                 <Set name="MaxSize">2</Set> 
                 <!-- Uncomment to setup other pool params as required          -->
                 <!--
                 <Set name="SleepTime">10</Set>        
                 <Set name="LifeTime">10</Set>         
                 <Set name="DeadLockMaxWait">10</Set>  
                 <Set name="DeadLockRetryWait">10</Set> 
                 <Set name="LoginTimeout">10</Set>      
                 <Set name="Debug" type="boolean">true</Set>
                 -->
               </New>
             </Arg>               
        </Call>
        <!-- set up a DataSource where the driver does the pooling                 -->
        <Call name="addDataSource">
             <Arg>jdbc/otherDB</Arg>   <!-- client lookup jndi name of datasource  -->
             <Arg>
               <New class="org.enhydra.jdbc.standard.StandardXADataSource">
                 <Set name="DriverName">com.mysql.jdbc.Driver</Set>
                 <Set name="Url">jdbc:mysql://localhost:3306/oln </Set>
                 <Set name="User"></Set>
                 <Set name="Password"></Set>
               </New>
             </Arg>
        </Call>
     </New>
   </Arg>
  </Call>
  
  
  <!-- =============================================================== -->  
  <!-- Set up a DataSourceService for non-XA types of DataSources      -->
  <!-- Any number of DataSources can be configured by calling          -->
  <!-- addDataSource().                                                -->
  <!-- =============================================================== --> 
  <Call name="addService">
    <Arg>
      <New class="org.mortbay.jetty.plus.DefaultDataSourceService">
        <Set name="Name">DataSourceService</Set>
        <!-- Add a javax.sql.DataSource. The implementation class can  -->
        <!-- be anything. StandardDataSource from XAPool is used here  -->
        <!-- as an example because it is included with the download.   -->
        <!-- Note that no support for connection pooling will be       -->
        <!-- available for connections from this DataSource unless     -->
        <!-- the DataSource implemenation provides it itself           -->
         <Call name="addDataSource">
             <Arg>jdbc/myNonXADataSource</Arg>  
             <!-- Configure the DataSource impl                        -->
             <Arg>
               <New class="org.enhydra.jdbc.standard.StandardDataSource">
                 <Set name="DriverName">org.hsqldb.jdbcDriver</Set>
                 <Set name="Url">jdbc:hsqldb:extra/etc/tmtest</Set>
                 <Set name="User">sa</Set>
                 <Set name="Password"></Set>
                <!-- bug work around only for StandardDataSource       -->
                 <Set name="Logger">
                   <New class="org.enhydra.jdbc.util.Logger">
                     <Arg>
                       <Call class="org.apache.commons.logging.LogFactory" name="getLog">
                         <Arg>org.enhydra.jdbc.xapool</Arg>
                       </Call>
                     </Arg>
                   </New>
                 </Set>                 
               </New>
             </Arg>
         </Call>
         <!-- Set up a connection pool using JDBC2 interfaces.         -->
         <!-- The DefaultDataSourceService uses XAPool to provide the -->
         <!-- pooling implementation.                                 -->
         <!-- If your driver vendor does not support the              -->
         <!-- javax.sql.ConnectionPoolDataSource interface, use the   -->
         <!-- StandardConnectionPoolDataSource from XAPool as an      -->
         <!-- adapter.                                                -->     
         <Call name="addConnectionPoolDataSource">
           <Arg>jdbc/myPooledDataSource</Arg>
           <Arg>                               
             <New class="org.enhydra.jdbc.standard.StandardConnectionPoolDataSource">
                 <Set name="DriverName">org.hsqldb.jdbcDriver</Set>
                 <Set name="Url">jdbc:hsqldb:extra/etc/tmtest</Set>
                 <Set name="User">sa</Set>
                 <Set name="Password"></Set>
                 <!-- workaround for XAPool bug                       -->
                 <Set name="Logger">
                   <New class="org.enhydra.jdbc.util.Logger">
                     <Arg>
                       <Call class="org.apache.commons.logging.LogFactory" name="getLog">
                         <Arg>org.enhydra.jdbc.xapool</Arg>
                       </Call>
                     </Arg>
                   </New>
                 </Set>                              
             </New>
           </Arg>
           <!-- configure the pool                                   -->
           <Set name="user">sa</Set>   
           <Set name="password"></Set>
           <Set name="minSize">1</Set>
           <Set name="maxSize">5</Set> 
         </Call>        
       </New>
     </Arg>
   </Call>
 

   


  <!-- =============================================================== -->
  <!-- Add a mail service                                              -->
  <!--  You must replace all XXX values below with values appropriate  -->
  <!--  for your installation.                                         -->
  <!-- =============================================================== -->
  <Call name="addService">
    <Arg>
      <New class="org.mortbay.jetty.plus.MailService">
        <Set name="Name">MailService</Set>
        <Set name="JNDI">mail/Session</Set>
	<!-- set up the id of the smtp user                 -->
        <Set name="User">XXX</Set>
	<!-- set up the password of the smtp user           -->
        <Set name="Password">XXX</Set>
	<!-- set up the hostname/ip addr of the smtp server -->
        <Put name="mail.smtp.host">XXX</Put>
	<!-- setup any javax.mail.smtp provider variables   -->
        <Put name="mail.pop3.user">zzz</Put>
        <Put name="mail.pop3.host">vvv</Put>
        <Put name="mail.from">me@me</Put>
        <Put name="mail.debug">false</Put>
      </New>
    </Arg>
  </Call>
         

  <!-- =============================================================== -->
  <!-- Configure the Request Listeners                                 -->
  <!-- =============================================================== -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add and configure a HTTP listener to port 8080                       -->
  <!-- The default port can be changed using: java -Djetty.port=80     -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SocketListener">
        <Set name="Port"><SystemProperty name="jetty.port" default="8080"/></Set>
        <Set name="MinThreads">10</Set>
        <Set name="MaxThreads">100</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="LowResourcePersistTimeMs">5000</Set>
      </New>
    </Arg>
  </Call>




  <!-- =============================================================== -->
  <!-- Configure the Contexts                                          -->
  <!-- =============================================================== -->


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Uncomment to configure a list of configurations to be applied   -->
  <!-- to each webapp context.                                         -->
  <!-- Note that order is significant. This can be changed per webapp  -->
  <!-- by calling setConfigurationClassNames() on the webapp context.  -->
  <!--                                                                 -->
  <!-- The jsr77 configuration is optional - if specified, jsr77       -->
  <!-- statistics will be enabled. You will also need to build the     -->
  <!-- extra/jsr77 package, include the jsr77 jars and start Jetty with -->
  <!-- jmx enabled. To make this easier, the JettyPlus start config     -->
  <!-- file sets up the classpath correctly, so make sure you use       -->
  <!-- -DSTART=extra/etc/start-plus.config and see the JettyPlus        -->
  <!-- README.TXT file for instructions on how to run with JMX enabled. -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!--
  <Set name="WebApplicationConfigurationClassNames">
    <Array type="java.lang.String">
      <Item>org.mortbay.jetty.plus.PlusWebAppContext$Configuration</Item>
      <Item>org.mortbay.jetty.servlet.JettyWebConfiguration</Item>
      <Item>org.mortbay.jetty.servlet.jsr77.Configuration</Item>
    </Array>
  </Set>
  -->


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add and configure a specific web application                    -->
  <!-- + Set Unpack WAR files                                          -->
  <!-- + Set Default Descriptor.  Resource, file or URL                -->
  <!-- + Set Virtual Hosts. A Null host or empty array means all hosts -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Call name="addWebApplication">
    <Arg>/jettyplus</Arg>
    <Arg><SystemProperty name="jetty.home"/>/extra/plus/demo/webapps/jettyplus</Arg>
    <!-- uncomment to allow env entries specified in this config file  -->
    <!-- to override env-entrys in web.xml                             -->
    <!--
    <Set name="WebXmlEnvEntryOverride">false</Set>
    -->
    <Call name="addEnvEntry">
      <Arg>my/trivial/name</Arg>
      <Arg type="Integer">99</Arg>
    </Call>
  </Call>


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add tomcat examples                                             -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Call name="addWebApplication">
      <Arg>/servlets-examples/*</Arg>
      <Arg><SystemProperty name="jetty.home" default="."/>/demo/webapps/servlets-examples.war</Arg>
      <!-- Uncomment to set up jsr77 statistics specifically for this webapp -->
      <!--
      <Set name="ConfigurationClassNames">
        <Array type="java.lang.String">
          <Item>org.mortbay.jetty.plus.PlusWebAppContext$Configuration</Item>
          <Item>org.mortbay.jetty.servlet.JettyWebConfiguration</Item>
          <Item>org.mortbay.jetty.servlet.jsr77.Configuration</Item>
        </Array>
    </Set>
    -->
  </Call>

  <Call name="addWebApplication">
      <Arg>/jsp-examples/*</Arg>
      <Arg><SystemProperty name="jetty.home" default="."/>/demo/webapps/jsp-examples.war</Arg>
  </Call>

  <!-- =============================================================== -->
  <!-- Configure the Request Log                                       -->
  <!-- =============================================================== -->
  <Set name="RequestLog">
    <New class="org.mortbay.http.NCSARequestLog">
      <Arg><SystemProperty name="jetty.home" default="."/>/logs/yyyy_mm_dd.request.log</Arg>
      <Set name="retainDays">90</Set>
      <Set name="append">true</Set>
      <Set name="extended">false</Set>
      <Set name="buffered">false</Set>
      <Set name="LogTimeZone">GMT</Set>
    </New>
  </Set>

  <!-- =============================================================== -->
  <!-- Configure the Other Server Options                              -->
  <!-- =============================================================== -->
  <Set name="requestsPerGC">2000</Set>
  <Set name="statsOn">false</Set>

</Configure>
