<!--
   - Resin 3.1 configuration file.
  -->
<resin xmlns="http://caucho.com/ns/resin"
       xmlns:resin="http://caucho.com/ns/resin/core">

  <!-- adds all .jar files under the resin/lib directory -->
  <class-loader>
    <tree-loader path="${resin.home}/lib"/>
    <tree-loader path="${server.root}/lib"/>
  </class-loader>

  <!--
     - Management configuration
    -->
  <!-- management path="${server.root}/admin">
  </management -->

  <!--
     - Logging configuration for the JDK logging API.
    -->
  <log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>

  <!--
     - 'info' for production
     - 'fine' or 'finer' for development and troubleshooting
    -->
  <logger name="com.caucho" level="info"/>

  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <!--
     - For production sites, change dependency-check-interval to something
     - like 600s, so it only checks for updates every 10 minutes.
    -->
  <dependency-check-interval>40s</dependency-check-interval>

  <!--
     - SMTP server for sending mail notifications
    -->
  <system-property mail.smtp.host="127.0.0.1"/>
  <system-property mail.smtp.port="25"/>

  <!--
     - You can change the compiler to "javac", "eclipse" or "internal".
    -->
  <javac compiler="internal" args="-source 1.5"/>

  <!-- Security providers.
     - <security-provider>
     -    com.sun.net.ssl.internal.ssl.Provider
     - </security-provider>
    -->

  <cluster id="app-tier">
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>

    <server-default>
      <!-- The http port -->
      <http address="*" port="8080"/>

      <!--
         - The JVM arguments
        -->
	<jvm-arg>-Di=NODE_ID</jvm-arg>
  	<jvm-arg>-Xms256m</jvm-arg>
	<jvm-arg>-Xmx8g</jvm-arg>
	<jvm-arg>-XX:+UseG1GC</jvm-arg>
	<jvm-arg>-XX:MaxGCPauseMillis=500</jvm-arg>
	<jvm-arg>-XX:+UseStringDeduplication</jvm-arg>
	<jvm-arg>-Djava.security.egd=file:///dev/urandom"</jvm-arg>
      <!-- jvm-arg>-Xdebug</jvm-arg>
      <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg -->

      <!--
         - Uncomment to enable admin heap dumps
         - <jvm-arg>-agentlib:resin</jvm-arg>

      <watchdog-arg>-Dcom.sun.management.jmxremote</watchdog-arg>
-->
      <watchdog-port>6752</watchdog-port>
      <!--
         - Configures the minimum free memory allowed before Resin
         - will force a restart.
        -->
      <memory-free-min>1M</memory-free-min>

      <!-- Maximum number of threads. -->
      <thread-max>256</thread-max>

      <!-- Configures the socket timeout -->
      <socket-timeout>65s</socket-timeout>

      <!-- Configures the keepalive -->
      <keepalive-max>128</keepalive-max>
      <keepalive-timeout>15s</keepalive-timeout>

      <!--
         - If starting bin/resin as root on Unix, specify the user name
         - and group name for the web server user.
         -
         - <user-name>resin</user-name>
         - <group-name>resin</group-name>
        -->
    </server-default>

    <!-- define the servers in the cluster -->
    <server id="entermedia" address="127.0.0.1" port="6852" />

    <!--
       - Configures the persistent store for single-server or clustered
       - in Resin professional.
      -->
    <resin:if test="${resin.isProfessional()}">
      <persistent-store type="cluster">
        <init path="session"/>
      </persistent-store>
    </resin:if>

    <!--
       - For security, use a different cookie for SSL sessions.
       - <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>
      -->

    <!--
       - Enables the cache (available in Resin Professional) 
      -->
    <resin:if test="${isResinProfessional}">
      <cache path="cache" memory-size="64M">
        <!-- Vary header rewriting for IE -->
        <rewrite-vary-as-private/>
      </cache>
    </resin:if>

    <!--
       - Enables periodic checking of the server status and
       - check for deadlocks..
       -
       - All servers can add <url>s to be checked.
      -->
    <resin:if test="${isResinProfessional}">
      <ping>
        <!-- <url>http://localhost:8080/test-ping.jsp</url> -->
      </ping>
    </resin:if>

    <!-- includes the app-default for default web-app behavior -->
    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!--
       - Defaults applied to each web-app.
      -->
    <web-app-default>
      <!--
         - Extension library for common jar files.  The ext is safe
         - even for non-classloader aware jars.  The loaded classes
         - will be loaded separately for each web-app, i.e. the class
         - itself will be distinct.
        -->
      <class-loader>
        <tree-loader path="${server.root}/ext-webapp"/>
      </class-loader>

      <!--
         - Sets timeout values for cacheable pages, e.g. static pages.
        -->
      <cache-mapping url-pattern="/" expires="5s"/>
      <cache-mapping url-pattern="*.gif" expires="60s"/>
      <cache-mapping url-pattern="*.jpg" expires="60s"/>
      <cache-mapping url-pattern="*.png" expires="60s"/>

      <!--
         - Enable EL expressions in Servlet and Filter init-param
        -->
      <allow-servlet-el/>

      <!--
         - for security, disable session URLs by default.
        -->
      <session-config>
        <enable-url-rewriting>false</enable-url-rewriting>
      </session-config>

      <!--
         - For security, set the HttpOnly flag in cookies.
         - <cookie-http-only/>
        -->
    </web-app-default>

    <!--
       - Sample database pool configuration
       -
       - The JDBC name is java:comp/env/jdbc/test
         <database>
           <jndi-name>jdbc/mysql</jndi-name>
           <driver type="org.gjt.mm.mysql.Driver">
             <url>jdbc:mysql://localhost:3306/test</url>
             <user></user>
             <password></password>
            </driver>
            <prepared-statement-cache-size>8</prepared-statement-cache-size>
            <max-connections>20</max-connections>
            <max-idle-time>30s</max-idle-time>
          </database>
      -->

    <!--
       - Default host configuration applied to all virtual hosts.
      -->
    <host-default>
      <!--
         - With another web server, like Apache, this can be commented out
         - because the web server will log this information.
        -->
<web-app-default>
      <access-log path="WEB-INF/logs/access.log" 
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1W"/>
	<stdout-log path="WEB-INF/logs/stdout.log" rollover-period="1W" />
    	<stderr-log path="WEB-INF/logs/stderr.log" rollover-period="1W" />
</web-app-default>

      <!-- creates the webapps directory for .war expansion -->
      <!-- web-app-deploy path="webapps"/ -->

      <!-- creates the deploy directory for .ear expansion -->
      <!-- ear-deploy path="deploy">
        <ear-default>
          <ejb-server>
            <config-directory>WEB-INF</config-directory>
            <data-source>jdbc/test</data-source>
          </ejb-server>
        </ear-default>
      </ear-deploy -->

      <!-- creates the deploy directory for .rar expansion -->
      <!-- resource-deploy path="deploy"/ -->
    </host-default>


    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="/media/services/websites">
      <host-default>
         <web-app-deploy path='webapps' />
	  <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

 <host id="">
  <web-app id='/' >
  	<document-directory>../demoall/webapp/</document-directory>
	<context-param entermedianodeid="eclipsenode1"/>
  </web-app>
 </host>

</cluster>

  <!--
     - Configuration for the web-tier/load-balancer
    -->
</resin>

