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

<body>

<summary objsummary='localtoc'/>

<section title="resin:type requires namespace">

<p>The configuration file validator is now more strict about the
namespace of resin:type.  The resin prefix must be defined as:</p>

<example>
&lt;resin xmlns="http://caucho.com/ns/resin"
       xmlns:resin="http://caucho.com/ns/resin/core">
  ...
</example>

</section>

<section title="resin:message replaces resin:log">

<p>resin:message replaces resin:log
since &lt;resin:log> and &lt;log> conflicted.  resin:log is now deprecated.
</p>
</section>

<section title="cluster-store has been removed">

<p>Use persistent-store instead.</p>

</section>

<section title="UserConnection.discardConnection()">

<p>Added com.caucho.sql.UserConnection.discardConnection() to allow
termination of broken connections undetected by the ping functionality.</p>

</section>

<section title="saving connection stack traces">

<p>For debugging, when database connections aren't closed, the
allocation stack traces are now automatically saved for subsequenct
allocations.</p>

</section>

<section title="cookie-http-only">

<p>Adds the <a href="http://msdn.microsoft.com/workshop/author/dhtml/httponly_cookies.asp">HttpOnly</a>
flag to all cookies generated in a web-app to avoid
cross-site scripting attacks.</p>

</section>

<section title="lazy-servlet-validate">

<p>If true, Resin will only check that the servlet-class exists when it's
actually used.  Normally, Resin will validate the
servlet-class immediately.</p>

</section>

<section title="ssl-session-cookie">

<p>ssl-session-cookie specifies an alternate session cookie for use in
secure connections.  This prevents the possibiliy of snooping the
non-SSL connection and then replaying the session cookie.</p>

</section>

<section title="ear-deploy, war-deploy">

<p>ear-deploy and war-deploy now have an expand-prefix to select
the expansion prefix, e.g. _ear_.</p>

<p>Also added require-file.</p>

<example>
&lt;ear-deploy path="deploy"
            expand-prefix=""
            require-file="META-INF/application.xml"/>

&lt;war-deploy path="deploy"
            expand-prefix=""
            require-file="WEB-INF/web.xml"/>
</example>

</section>

<section title="server-header">

<p>The &lt;server> section now accepts a &lt;server-header> to override
the Server response header.</p>

</section>

<section title="Class reloading">

<p>Class reloading is now available for Resin-OS and can be used
with agentlib</p>

</section>

<section title="CauchoConfigCacheDirectory">

<p>Apache directive to set the cached mapping file.</p>

</section>

<section title="keepalive-max">

<p>&lt;http> now has a &lt;keepalive-max> attribute.</p>

</section>

<section title="merge: VFS schema">

<p>Path values now support a merge schema.  The merge path is
a collection of paths, like a classpath.  The syntax is: "merge:(foo/bar;baz)", i.e. it uses ';' as a path separator.</p>

<p>The most important use of the merge schema is for a web-app
document-directory, allowing for development or customization enhancements
without affecting the raw web-app.</p>

<example>
&lt;web-app id="foo" document-directory="merge:(../custom-foo;foo)"/>
</example>

</section>

<section title="@TransactionAttribute and  AOP MethodInterceptor">

<p>The EJB 3.0 @TransactionAttribute capability is now available for
any Java class.  It is no longer restricted to SessionBeans.</p>

<p>The <a href="ejb3|tutorial/resin-xa/index.xtp">@TransactionAttribute</a>
support can now be applied to any bean without any Resin-specific
annotations.  In addition, the attribute class is configurable.</p>

<example title="example/MyClass.java">
package example;

import javax.ejb.TransactionAttribute;

public class MyClass {
  ...
  @TransactionAttribute
  public void myFoo()
  {
    ...
  }
}
</example>

<example title="resin-web.xml">
&lt;web-xml xmlns="http://caucho.com/ns/resin">
  &lt;classloader>
    &lt;enhancer>
      &lt;method annotation="javax.ejb.TransactionAttribute"
               type="com.caucho.transaction.enhancer.TransactionEnhancer"/>
    &lt;/enhancer>
  &lt;/classloader>

  ...
&lt;/web-xml>
</example>

<p>The enhancer also supports AOP Alliance MethodInterceptors, allowing
for custom annotations.</p>

<example title="resin-web.xml">
&lt;web-xml xmlns="http://caucho.com/ns/resin">
  &lt;classloader>
    &lt;enhancer>
      &lt;method annotation="example.MyAnnotation"
               type="example.MyMethodInterceptor"/>
    &lt;/enhancer>
  &lt;/classloader>

  ...
&lt;/web-xml>
</example>


<file file="example.MyMethodInterceptor">
package example;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MyMethodInterceptor implements MethodInterceptor {
  public Object invoke(MethodInvocation inv) throws Throwable
  {
    System.out.println("<method>");
    try {
      return inv.proceed();
    } finally {
      System.out.println("</method>");
    }
  }
}
</file>

</section>

<section title="log mbean-name">

<p>Logs can now have an mbean-name.</p>

<example>
&lt;log name="qa.Test" mbean-name="type=Log,name=qa.Test"
        path="log/test.log" level="fine"/>
</example>

<p>The MBean interface is com.caucho.log.mbean.LogMBean.</p>

</section>

<section title="META-INF/resin-ejb-jar.xml">

<p>Added resin-ejb-jar.xml for EJBs.  Resin already parses META-INF/foo.ejb files.</p>

</section>

<section title="shutdown-wait-max">

<p>shutdown-wait-max is now also a configurable item in the &lt;resin> block.
It's necessary to set the &lt;resin> value as well as the &lt;web-app> value.</p>

</section>

<section title="lazy web-app and idle-time">

<p>Lazy web-apps (start-mode="lazy"), are now automatically undeployed
when idle-time is expired (default 2h).</p>

</section>

<section title="resin.jar startup">

<p>To allow for resin.conf to configure the JVM parameters, resin.jar
for Resin-Professional now can start a Resin daemon.</p>

<example>
unix> java -jar lib/resin.jar start
...
unix> java -jar lib/resin.jar stop
</example>

</section>

<section title="bind-ports-after-start">

<p>If true, listen to the http ports after the server is done initializing.</p>
</section>

<section title="multipart form">

<p>The multipart form processing can now accept a "caucho.multipart.form.upload-max" request attribute to set the size on a per-request basis.</p>

<p>The multipart form error now returns a "caucho.multipart.form.error.size".</p>

</section>

<section title="error-page in server">

<p>error-page is now allowed in &lt;server> to handle &lt;busy> pages.</p>

</section>

<section title="rewrite-dispatch">

<p>The dispatch functionality of mod_rewrite has been added.  Currently,
it only supports redirect.</p>

<example>
&lt;rewrite-dispatch>
  &lt;redirect regexp='^/foo' target='http://www.foo.com'/>
&lt;/rewrite-dispatch>
</example>

</section>

<section title="rewrite-real-path">

<p>The real-path functionality of mod_rewrite has been added.  It
applies to the getRealPath mapping.</p>

<example>
&lt;rewrite-real-path>
  &lt;rewrite regexp='/(foo)' replacement='/-$1-$0'/>
&lt;/rewrite-real-path>
</example>

</section>

<section title="programmatic DBPool">

<p>The DBPool can now be used to create Pools programmatically.  It's
still strongly recommended to use the configuration file instead.</p>

<example>
TestDriver driver = new TestDriver();

DBPool pool = new com.caucho.sql.DBPool();
pool.setJndiName("test");
pool.setJDBCDriver(driver);
pool.setURL("jdbc:test:foo");
pool.init();
</example>

</section>

<section title="servlet-mapping schema">

<p>The servlet-mapping schema was incorrect for the Resin namespace.
The correct order is servet-name, url-pattern.</p>

</section>

<section title="invocation-cache-size">

<p>New &lt;server> parameters: invocation-cache-size and invocation-cache-max-url-size (default 256)</p>

</section>

<section title="client-read-timeout">

<p>The client-read-timeout is now available in cluster-definition.</p>

</section>

<section title="caching">

<p>The caching backing has changed to a more efficient backing store.</p>

</section>

<section title="cache/max-entry-size">

<p>The &lt;cache> has a new parameter: max-entry-size.</p>

</section>


<section title="cluster session">

<p>The cluster session store has changed to a more efficient backing store.</p>

</section>

<section title="Configuration">

<section title="resin:type">

<p>resin:type can now be used in more places, for example in string values,
allowing custom classes to computer values.</p>

<example>
&lt;driver type="com.foo.DataSource">
  &lt;url>jdbc:foo://localhost&lt;/url>
  &lt;password resin:type="foo.Password">Xm91/zI==&lt;/password>
&lt;/driver>
</example>

<example title="foo/Password.java">
package foo;

public class Password {
  String _value;

  public void addText(String value)
  {
    _value = value;
  }

  public Object replaceObject()
  {
    return decode(_value);
  }
}
</example>
</section>

<section title="resin:resource">

<p>&lt;resin:resource> (and &lt;resource>) now allow a var="foo" attribute,
which sets configuration variables.  This lets configuration files set
temporary resources without using jndi.</p>

<p>In the following example, the MyBean object has a <code>setData</code>
method.  The resin:resource creates a temporary variable.</p>

<example>
&lt;my-bean xmlns:resin="http://caucho.com/ns/resin/core">
  &lt;resin:resource var="foo" type="qa.MyResource"/>

  &lt;data>${foo}&lt;/data>
&lt;/my-bean>
</example>

<p>resin:resource is now allowed anywhere, including in a custom bean.</p>

</section>

<section title="com.caucho.config.Config">

<p>The com.caucho.config.Config facade now makes it easy to use
Resin's dependency-injection configuration machinery for custom classes.
The <code>configure</code> method takes a Java object and
an <code>InputStream</code> to the configuration file and
configures the object.</p>

<example>
InputStream is = new FileInputStream("conf.xml");
try {
  Config.configure(myObject, is);
} finally {
  is.close();
}
</example>

</section>

</section>

<section title="Acknowledgements">

<p>Thanks to Dave Brosius for locating bugs in XML parsing, EJB-QL, and Amber query caching.</p>

<p>Thanks to Bin for adding the batch compilation capability to JspCompiler.</p>

</section>

</body>
</document>
