<document>
  <header>
    <product>resin</product>
    <title>Resin 3.0.7 Release Notes</title>
  </header>

<body>

<summary objsummary='localtoc'/>

<section title="Overview">

<p>Resin 3.0.7 includes a number of configuration changes for the
more advanced user.  It also includes a large number of bug fixes
and some performance enhancements.</p>

</section>

<section title="Configuration control">

<p>The resin.conf and web.xml configuration files can now use
resin:if and resin:choose control.  These can be useful to create
a resin.conf which works for both testing and deployment, depending on
an environment parameter.</p>

<p>When possible, users should avoid using the control tags when possible
to keep their configuration files as simple as possible.</p>

<example>
&lt;web-app xmlns="http://caucho.com/ns/resin"
            xmlns:resin="http://caucho.com/ns/resin/core">
  &lt;resin:choose>
  &lt;resin:when test="\${mode='development'}">
    &lt;resin:log>Development Mode&lt;/resin:log> 
  &lt;/resin:when>
  &lt;resin:when test="\${mode='deploy'}">
    &lt;resin:log>Deployment Mode&lt;/resin:log> 
  &lt;/resin:when>
  &lt;resin:otherwise>
    &lt;resin:log>Unknown Mode \${mode}&lt;/resin:log>
  &lt;/resin:otherwise>
&lt;/web-app>
</example>

<section title="resin:set">

<p>resin:set adds an EL variable to the current context.</p>

<def>
&lt;resin:set var="name" value="\${value}"/>
</def>

</section>

<section title="resin:if">

<p>resin:if executes part of the configuration file conditionally.<p>

<def>
&lt;resin:if test="${expr}">
  ...
&lt;resin:if>
</def>

</section>

<section title="resin:choose">

<p>resin:choose implements an if, elsif, else.</p>

<def>
&lt;resin:choose>
&lt;resin:when test="${expr1}">
  ...
&lt;/resin:when>
&lt;resin:when test="${expr2}">
  ...
&lt;/resin:when>
&lt;resin:otherwise>
&lt;/resin:otherwise>
</def>

</section>

<section title="resin:env">

<p>resin:env creates a new environment for a section of the
configuration file.  Some users may want to use this to create resources
or databases with custom &lt;class-loader> tags.</p>

<example>
&lt;web-app>
  ..
  &lt;resin:env>
    &lt;class-loader>
      &lt;library-loader path="/opt/customlib"/>
    &lt;/class-loader>

    &lt;resource ...>
  &lt;/resin:env>
  ...
</example>

</section>

<section title="resin:log">

<p>Logs a message to the given log file.</p>

</section>

<section title="resin:import">

<p>resin:import now replaces resin:include.
The behavior is a bit different.  The target file now is validated by
schema where the schema depends on the location of the resin:import.
So a resin:import in &lt;server> will have a target with a top-level now
of &lt;server>.
</p>

<p>resin:import also allows a &lt;fileset> attribute.</p>

</section>

</section>

<section title="Batch Compilation">

<p>The compiling-loader will now batch as many changed *.java files as it finds and will submit all at once for compilation.</p>

<p>The "batch" attribute of compiling-loader controls this behavior.</p>
</section>

<section title="Logging">

<p>The &lt;log> tag now supports multiple &lt;logger> children.</p>

<example>
&lt;log path='log/connections.log' timestamp='[%H:%M:%S.%s] '/>
  &lt;logger name='com.caucho.server.port.TcpConnection' level='all'/>
  &lt;logger name='com.caucho.server.http.HttpRequest' level='all'/>
&lt;/log>
</example>

</section>

<section title="Apache">

<p>Manual configuration has been restored to mod_caucho.</p>

<p>The configuration looks like:</p>

<example>
LoadModule caucho_module /usr/local/apache2/modules/mod_caucho.so

CauchoHost localhost 6802
&lt;Location /test/*>
  SetHandler caucho-request
&lt;/Location>
</example>

</section>

<section title="Clustering">

<p>The cluster-definition and cluster-ref have now been properly added.</p>

<example title="backend.conf">
&lt;resin xmlns="http://caucho.com/ns/resin">
&lt;server>
  &lt;cluster-definition id='foo.com'>
    &lt;srun id="foo" index='1' host='localhost' port='6810'/>
  &lt;/cluster-definition>

  &lt;cluster-definition id='bar.com'>
    &lt;srun id="bar" index='2' host='localhost' port='6811'/>
  &lt;/cluster-definition>

  &lt;host-default>
    &lt;cluster cluster-ref="${host.name}"/>
    &lt;web-app id="/"/>
  &lt;/host-default>

  &lt;host id="foo.com" root-directory="foo"/>
  &lt;host id="bar.com" root-directory="bar"/>
&lt;/server>
&lt;/resin>
</example>

<example title="frontend.conf">
&lt;resin xmlns="http://caucho.com/ns/resin">
  &lt;server>
    &lt;cluster-definition id='foo.com'>
      &lt;srun id="a" index='1' host='localhost' port='6810'/>
    &lt;/cluster-definition>

    &lt;cluster-definition id='bar.com'>
      &lt;srun id="b" index='2' host='localhost' port='6811'/>
    &lt;/cluster-definition>

    &lt;host-default>
      &lt;web-app id='/'>
        &lt;servlet servlet-name='remote'
                 servlet-class='com.caucho.servlets.HmuxLoadBalanceServlet'>
          &lt;init-param cluster="${host.name}"/>
        &lt;/servlet>

        &lt;servlet-mapping url-pattern='/*' servlet-name='remote'/>
      &lt;/web-app>
    &lt;/host-default>

    &lt;host id='foo.com'/>
    &lt;host id='bar.com'/>
  &lt;/server>
&lt;/resin>
</example>

</section>

<section title="Database">

<p>The database configuration now allows for a backup driver.
Multiple &lt;driver> blocks round-robin the load.</p>

<example>
&lt;database>
  &lt;jndi-name>jdbc/mysql&lt;/jndi-name>

  &lt;driver type="org.gjt.mm.mysql.Driver">
    &lt;url>jdbc:mysql://gryffindor:3306/test&lt;/url>
  &lt;/driver>

  &lt;driver type="org.gjt.mm.mysql.Driver">
    &lt;url>jdbc:mysql://hufflepuff:3306/test&lt;/url>
  &lt;/driver>

  &lt;backup-driver type="org.gjt.mm.mysql.Driver">
    &lt;url>jdbc:mysql://slytherin:3306/test&lt;/url>
  &lt;/backup-driver>
&lt;/database>
</example>

</section>

<section title="JMX">

<p>Resin's JMX has been upgraded to support JDK 1.5.
The MBeanServer at java:comp/jmx/MBeanServer makes the
JDK java.lang.monitoring available.</p>

</section>

<section title="Apache 2.0 enhancements">

<p>mod_caucho can now have individually configured ResinConfigServer in
separate &lt;Location> blocks.</p>
</section>

<section title="Burlap/Hessian">

<p>Added com.caucho.hessian.io.BeanSerializerFactory to allow bean-style
serialization instead of requiring field serialization.</p>

</section>

<section title="Classloader">

<p>library-loader now accepts fileset.</p>

</section>

<section title="Distributed XA Logging">

<p>The transaction manager can now be configured for
distributed XA logging and recovery.  The log does not affect
single-resource transactions.</p>

<example title="resin.conf">
&lt;resin xmlns="http://caucho.com/ns/resin">
  &lt;transaction-manager>
    &lt;transaction-log>
      &lt;path>file:/var/xalog/log1&lt;/path>
    &lt;/transaction-log>
  &lt;/transaction-manager>

  ...
&lt;/resin>
</example>
</section>

<section title="JSP batch precompilation">

<p>A new resource, com.caucho.jsp.JspPrecompileResource, will precompile
JSP files on web-app startup.  This compilation is batched to a single
javac invocation, which generally improves JSP compilation and
startup performance.</p>
</section>

</body>
</document>
