<?xml version="1.0" encoding="UTF-8"?>

<!-- The service configuration for the embedded Tomcat4.1.x web container
-->
<server>

   <mbean code="org.jboss.web.tomcat.tc4.EmbeddedTomcatService"
      name="jboss.web:service=WebServer">

      <attribute name="CatalinaBase">${jboss.server.temp.dir}</attribute>
      <attribute name="CatalinaHome">${jboss.server.temp.dir}</attribute>

      <!-- Get the flag indicating if the normal Java2 parent first class
      loading model should be used over the servlet 2.3 web container first
      model.
      -->
      <attribute name="Java2ClassLoadingCompliance">true</attribute>

      <attribute name="LenientEjbLink">true</attribute>

      <!-- A flag indicating if the JBoss Loader should be used. This loader
      uses a unified class loader as the class loader rather than the tomcat
      specific class loader.
      -->
      <attribute name="UseJBossWebLoader">false</attribute>

      <!-- The name of the request attribute under with the authenticated JAAS
      Subject is stored on successful authentication. If null or empty then
      the Subject will not be stored.
      -->
      <attribute name="SubjectAttributeName">j_subject</attribute>

      <!--
        *******************************************************
        ****************** CLUSTERING *************************
        *******************************************************
        In order to activate HTTP Session clustering for Tomcat
        make sure you run JBoss's "all" configuration i.e.
        "run -c all"
        (the default configuration doesn't contain clustering)

        Furthermore, you may change SnapshotMode and
        SnapshotInterval attributes below to indicate when to
        synchronize changes with the other node(s).

        If you use Apache+mod_jk(2) you will most probably use
        the AJP1.3 connector below. Thus, if you so wish,
        you may comment (i.e. deactivate) the HTTP connector
        as it won't be used anymore.

        *******************************************************
        *******************************************************
        *******************************************************
       -->

      <!--
        If you are using clustering, the following two attributes
        define when the sessions are replicated to the other nodes.
        The default value, "instant", synchronously replicates changes
        to the other nodes. In this case, the "SnapshotInterval" attribute
        is not used.
        The "interval" mode, in association with the "SnapshotInterval"
        attribute, indicates that Tomcat will only replicates modified
        sessions every "SnapshotInterval" miliseconds at most.
      -->
      <attribute name="SnapshotMode">instant</attribute> <!-- you may switch to "interval" -->
      <attribute name="SnapshotInterval">2000</attribute>

      <attribute name="Config">
         <Server>
            <Service name="JBoss-Tomcat">
               <Engine name="MainEngine" defaultHost="localhost">
                  <Logger className="org.jboss.web.tomcat.Log4jLogger"
                     verbosityLevel="INFORMATION" category="org.jboss.web.localhost.Engine"/>
                  <Host name="localhost">

                     <!-- Access logger -->
                     <Valve className="org.apache.catalina.valves.AccessLogValve"
                        prefix="localhost_access" suffix=".log"
                        pattern="common" directory="/Library/Logs/JBoss"/>

                     <!-- This valve clears any caller identity set by the realm
                     and provides access to the realm about the existence of an
                     authenticated caller to allow a web app to run with a realm
                     that support unauthenticated identities. It also establishes
                     any run-as principal for the servlet being accessed.
                     -->
                     <Valve className="org.jboss.web.tomcat.security.SecurityAssociationValve"/>
                     <!-- Default context parameters -->
                     <DefaultContext cookies="true" crossContext="true" override="true"/>

                  </Host>
               </Engine>

               <!-- SSL/TLS Connector configuration using the SSL domain keystore -->
               <!--Connector className = "org.apache.catalina.connector.http.HttpConnector" port = "8443" scheme = "https" secure = "true"
                          minProcessors="5" maxProcessors="200" address="0.0.0.0"
                          enableLookups="false" acceptCount="50" debug="0"
                          connectionTimeout="20000" >
                 <Factory className = "org.jboss.web.catalina.security.SSLServerSocketFactory"
                          securityDomainName = "java:/jaas/RMI+SSL" clientAuth = "false" />
               </Connector-->

               <!-- A HTTP/1.1 Connector on port 8080 -->
               <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
                          port="8080" minProcessors="5" maxProcessors="200" address="0.0.0.0"                  
                          enableLookups="false" acceptCount="50" debug="0" redirectPort="8443"
                          connectionTimeout="20000"/>

               <!-- An AJP 1.3 Connector on port 9007. Used by Apache mod_jk -->
               <!--Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
                          port="9007" minProcessors="5" maxProcessors="200" address="0.0.0.0"                  
                          enableLookups="false" acceptCount="50" debug="0"
                          connectionTimeout="20000"
                          protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/-->

               <!-- SSL/TLS Connector configuration using the SSL domain keystore -->
               <Connector className = "org.apache.coyote.tomcat4.CoyoteConnector"
                 address="0.0.0.0" port = "8443" scheme = "https" secure = "true">
                 <Factory className = "org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
                   keystoreFile="/Library/JBoss/3.2/lib/jboss.keystore"
                   keystorePass="rmi+ssl"
                   protocol = "TLS"/>
               </Connector>
                

               <!-- SSL/TLS Connector configuration using the SSL domain keystore
               <Connector className = "org.apache.coyote.tomcat4.CoyoteConnector"
                 address="${jboss.bind.address}" port = "8443" scheme = "https" secure = "true">
                 <Factory className = "org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
                   keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
                   keystorePass="rmi+ssl"
                   protocol = "TLS"/>
               </Connector>
               --> 
            </Service>
         </Server>
      </attribute>
      <depends>jboss:service=TransactionManager</depends>
      <depends>jboss.security:service=JaasSecurityDomain,domain=RMI+SSL</depends> 
   </mbean>

</server>

