<?xml version="1.0" encoding="UTF-8"?>
<!--
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - JOnAS: Java(TM) Open Application Server
  - Copyright (C) 2007 Bull S.A.S.
  - Contact: jonas-team@ow2.org
  -
  - This library 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 library 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 library; if not, write to the Free Software
  - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - $Id: tomcat6-mod_jk.xml 17350 2009-05-13 14:15:43Z fornacif $
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->

<!--
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - Tomcat 6 server.xml file with some configuration steps for JOnAS already done (Realm, etc).
  - Note:  A "Server" is not itself a "Container", so you may not define subcomponents such
  - as "Valves" at this level.
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Server>

  <!--APR library loader -->
  <!-- uncomment this listener for enabling APR -->
  <!-- <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> -->
  <!--Initialize Jasper prior to webapps are loaded. -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- JMX Support for the Tomcat server. -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- No Global JNDI resources. Use JOnAS resources -->
  <GlobalNamingResources>
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
   -->
  <Service name="JOnAS">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned.
         Java HTTP Connector (blocking & non-blocking)
         Java AJP  Connector
         APR (HTTP/AJP) Connector
         Define a non-SSL HTTP/1.1 Connector on port 9000
    -->
    <Connector port="9000" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="9043" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="9000" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="9043" />
    -->
    <!-- Define a SSL HTTP/1.1 Connector on port 9043
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="9043" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

     <!-- Define an AJP 1.3 Connector on port 9010 -->
    <Connector port="9010" enableLookups="false"
               redirectPort="9043" protocol="AJP/1.3" />

    <!-- Define an AJP 1.3 Connector on port 9009 -->
    <!--
    <Connector port="9009" protocol="AJP/1.3" redirectPort="9043" />
    -->


    <!-- An Engine represents the entry point (within JOnAS/Tomcat) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host). -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="JOnAS" defaultHost="localhost" jvmRoute="worker1">

      <!-- For the clustering, look at the documentation
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>-->


      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat. -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- Because this Realm is here, an instance will be shared globally -->

      <!-- This Realm uses the JOnAS resource memrlm_1
           defined by JONAS_BASE/conf/jonas-realm.xml file -->
      <Realm className="org.ow2.jonas.web.tomcat6.security.Realm" resourceName="memrlm_1" />

      <!-- Note that the validation can be turned on/off in JOnAS configuration
           So, in order to avoid to make the validation twice, it's recommended
           to let the validation to off.
           Add the following attributes if you want to turn XML validation
           on. Remember to comment the Host element above. -->
      <!-- Define the default virtual host -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="false" autoDeploy="false"
            deployOnStartup="false" deployXML="false"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web applications -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example. -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->


        <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
            channelSendOptions="8">
            <Manager className="org.apache.catalina.ha.session.DeltaManager"
                expireSessionsOnShutdown="false"
                notifyListenersOnReplication="true"/>
            <Channel className="org.apache.catalina.tribes.group.GroupChannel">
                <Membership
                    className="org.apache.catalina.tribes.membership.McastService"
                    addr="228.0.0.4"
                    port="45564"
                    frequency="500"
                    dropTime="3000" />
                <Receiver
                    className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                    address="auto"
                    port="4003"
                    autoBind="100"
                    selectorTimeout="100"
                    maxThread="6" />
                <Sender
                    className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                    <Transport
                        className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
                </Sender>
                <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
                <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
            </Channel>
            <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
                 filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;" />
            <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
            <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
            <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
        </Cluster>
      </Host>
    </Engine>
  </Service>
</Server>
