<?xml version="1.0"  encoding="UTF-8"?>
<!-- ****************************************** {COPYRIGHT-TOP} **
* Aperi Storage Manager
* (C) Copyright Eclipse contributors and others. 2007
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************* {COPYRIGHT-END} * -->
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">



<!-- =============================================================== -->
<!-- Configure the Jetty Server                                      -->
<!-- =============================================================== -->
<!-- $Id: jetty.xml,v 1.3 2007/04/27 15:17:10 rciurea Exp $ -->
<Configure class="org.mortbay.jetty.Server">


  <!-- =============================================================== -->
  <!-- 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="org.eclipse.aperi.reporting.port" default="8080"/></Set>
        <Set name="MinThreads">5</Set>
        <Set name="MaxThreads">100</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="LowResourcePersistTimeMs">5000</Set>
        <Set name="PoolName">Listener</Set>
      </New>
    </Arg>
  </Call>


  <!-- =============================================================== -->
  <!-- Set the default web application configuration mechanisms:       -->
  <!--   XMLConfiguration       - handles WEB-INF/web.xml              -->
  <!--   JettyWebConfiguration  - handles WEB-INF/jetty-web.xml        -->
  <!--   jsr77.Configuration    - Adds jsr77 statistics to servlets    -->
  <!--                                                                 -->
  <!-- Order of these classes is significant. The defaults set here    -->
  <!-- can be overridden by calling setConfigurationClassNames() on    -->
  <!-- the webapp context.                                             -->
  <!-- The jsr77 configuration requires additional jars on the         -->
  <!-- on the classpath (use -DSTART=extra/etc/start-jsr77.config) and -->
  <!-- it needs jmx enabled (see README.TXT for instructions).         -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Set name="WebApplicationConfigurationClassNames">
    <Array type="java.lang.String">
      <Item>org.mortbay.jetty.servlet.XMLConfiguration</Item>
      <Item>org.mortbay.jetty.servlet.JettyWebConfiguration</Item>
    </Array>
  </Set>


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


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add aperi-reports web application                               -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Call name="addWebApplication">
    <Arg>/aperi-reports/*</Arg>
    <Arg><SystemProperty name="org.eclipse.aperi.reporting.web" />/aperi-reports</Arg>
    <Set name="extractWAR">false</Set>
    <Set name="Realm">
      <New class="org.mortbay.jaas.JAASUserRealm">
	  	<Set name="Name">OSRealm</Set>
	  	<Set name="LoginModuleName">os</Set>
	  	<Set name="RoleCheckPolicy">
		    <New class="org.mortbay.jaas.StrictRoleCheckPolicy"/>
		</Set>
		<Set name="CallbackHandlerClass">
		    org.mortbay.jaas.callback.DefaultCallbackHandler
		</Set>
      </New>
    </Set>
  </Call>


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add birt-viewer web application                                 -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Call name="addWebApplication">
    <Arg>/birt-viewer/*</Arg>
    <Arg><SystemProperty name="org.eclipse.aperi.reporting.web" />/birt-viewer</Arg>
    <Set name="Realm">
      <New class="org.mortbay.jaas.JAASUserRealm">
	  	<Set name="Name">OSRealm</Set>
	  	<Set name="LoginModuleName">os</Set>
	  	<Set name="RoleCheckPolicy">
		    <New class="org.mortbay.jaas.StrictRoleCheckPolicy"/>
		</Set>
		<Set name="CallbackHandlerClass">
		    org.mortbay.jaas.callback.DefaultCallbackHandler
		</Set>
      </New>
    </Set>
  </Call>

  <!-- System classes cannot be overriden by a HttpContext or webapp -->
  <Set name="systemClasses">
    <Array type="java.lang.String">
      <Item>java.</Item>
      <Item>javax.servlet.</Item>
      <Item>javax.xml.</Item>
      <Item>org.mortbay.</Item>
      <Item>org.xml.</Item>
      <Item>org.w3c.</Item>
    </Array>
  </Set>

  <!-- Server classes are hidden from a HttpContext or webapp -->
  <Set name="serverClasses">
    <Array type="java.lang.String">
      <Item>-org.mortbay.http.PathMap</Item>
      <Item>-org.mortbay.</Item>
      <Item>org.mortbay.start.</Item>
      <Item>org.mortbay.stop.</Item>
      <Item>org.mortbay.jetty.Server</Item>    
    </Array>
  </Set>


</Configure>





