Caucho maker of Resin Server | Application Server (Java EE Certified) and Web Server


 

Resin Documentation

home company docs 
app server 
 Resin Server | Application Server (Java EE Certified) and Web Server
 

resin 4.0.4 release notes


  • Pass Servlet 3.0 TCK for JavaEE 6 web profile
  • com.caucho.resin.ResinBeanContainer for embedded Resin use
  • com.caucho.junit.ResinJUnitRunner for embedded junit use
  • Quercus support for PHP 5.3 Namespaces
  • Quercus support for PHP 5.3 Closures

Resin 4.0.4 Overview

  • Pass Servlet 3.0 TCK for JavaEE 6 web profile
  • com.caucho.resin.ResinBeanContainer for embedded Resin use
  • com.caucho.junit.ResinJUnitRunner for embedded junit use
  • Quercus support for PHP 5.3 Namespaces
  • Quercus support for PHP 5.3 Closures

Resin 4.0.x is the active development branch.

Servlet 3.0 TCK for Web Profile

Passing the Servlet 3.0 TCK in 4.0.4 is the first step for Resin to complete the JavaEE-6 Web Profile. The web profile is our primary focus for the next few months. It's the "good bits" of JavaEE-6: all the specifications aimed at developing web applications without the legacy enterprise requirements like CORBA that only specialized applications use.

Our plan is to continue passing new TCKs for each of the next few 4.0.x releases until we are done with the web profile.

Embedded ResinContext

The new embedded ResinContext lets you use Resin's CanDI and EJB environment in a non-Resin context like a JUnit test or even in a standalone application.

The simplest use of Resin context scans for *.jar files with CanDI beans.xml or EJB ejb-jar.xml files and lets you start a CanDI request scope.

Embedded Requests

Example: ResinBeanContainer
import com.caucho.resin.*;

public class MyMain {
  static void main(String []argv)
  {
    ResinBeanContainer resinContext = new ResinBeanContainer();

    // scan classpath and initialize @Startup beans
    resinContext.start();

    // start a new request
    RequestContext cxt = resinContext.beginRequest();

    try {
      MyBean bean = cxt.newInstance(MyBean.class);

      bean.doStuff();
    } finally {
      cxt.close();
    }
  }
}

Configuring beans

You can configure the beans XML using the same environment tags as are available to the resin.xml and resin-web.xml like <mypkg:MyBean> for CanDI, <database> for databases, and <resin:import> to include files.

Example: beans.xml
<beans xmlns="http://caucho.com/ns/resin"
   xmlns:lang="urn:java:java.lang"
   xmlns:ee="urn:java:ee">

  <mypkg:MyBean xmlns="urn:java:com.mycom.mypkg">
    <my-field>my-value</my-field>
  </mypkg:MyBean>

  <lang:String>
    <new>my-config-value</new>
    <ee:Named>my-config-name</ee:Named>
  </lang:String>

  <database name="my-db">
    <driver type="..." url="..."/>
  </database>
    
</beans>

ResinBeanContainerRunner

The ResinBeanContainer has an associated JUnit @RunWith runner, letting you create JUnit tests for your model code in Resin's CDI environment.

Example: test junit
package qa;

import org.junit.*;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
import com.caucho.junit.ResinBeanContainerRunner;
import javax.inject.*;

@RunWith(ResinBeanContainerRunner.class)
@ResinBeanConfiguration(beansXml="test.xml")
public class MyTest {
  @Inject MyBean _myBean;
  
  @Test public void simpleTest()
  {
    assertTrue(_myBean != null);
  }
}

PHP 5.3 Namespaces and Closures

Quercus in 4.0.4 has implemented the namespaces and closures capabilities of PHP 5.3. Namespaces finally give PHP the ability to isolate functions and classes with unique names.

Closures add functional programming capabilities to PHP, giving power to more powerful event-driven frameworks.

In addition to the major language changes, Quercus has completed its support for variable class methods and late static binding, both features are used in new-generation PHP frameworks to improve templating power and clarity.


Copyright © 1998-2015 Caucho Technology, Inc. All rights reserved. Resin ® is a registered trademark. Quercustm, and Hessiantm are trademarks of Caucho Technology.