main website home
  • About this blog

    This blog features updates, opinions, and technical notes from Caucho engineers about Caucho products, the enterprise Java industry, and PHP. Caucho Technology is the creator of the Resin Application Server and the Quercus PHP in Java engine. A leader in Java performance since 1998, Caucho is a Sun JavaEE licensee with over 9000 customers worldwide.
  • Tags

    ajaxworld bam candi cdi cloud cluster comet deploy devoxx eclipse ejb embedded flash flex google app engine hessian hmtp ioc java ee 6 javaone javazone jms messaging mule newsletter nyjug osgi php pomegranate quercus resin resin 4.0 REST servlet sfjug silicon valley code camp spring testing training tssjs watchdog webbeans web profile websockets wordpress
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Does Resin Support EJB remoting?

May 16th, 2012 by rick

The short answer is no. The longer answer is that Resin supports Hessian for remoting. And, in about 20 lines of code, you can expose all @Stateless/@Remote beans as remote services using the Hessian protocol using CDI and Servlet 3.0, which are part of Resin and part of Java EE Web Profile (as Resin 4 is a Java EE Web Profile certified application server).

Hessian (now Hessian 2) predates many other forms of remoting and is a [http://daniel.gredler.net/2008/01/07/java-remoting-protocol-benchmarks/ wicked fast, binary protocol] (faster than CORBA, RMI, SOAP, XML-RPC, etc). You could think of Hessian as a high performance binary JSON. Hessian has been ported to many languages. Hessian is a remoting framework and a flexible Java serialization framework.

You can expose any bean as a Hessian remote bean quite easily. Hessian has been around for 10 years, and is very solid. (Both Hessian and Resin are development and maintained by Caucho).

Resin 4 documentation does not have Hessian documentation yet, but Hessian usage has not changed in years. You can find a good tutorial on getting started with Hessian from the [http://www.caucho.com/resin-3.0/protocols/hessian.xtp Resin 3 documentation]. I’ve tried these tutorial steps in Resin 4 and the tutorial works as advertised.

Resin 4 is Java EE Web Profile certified as such it does not support CORBA, EJB remoting, etc. However Resin does support Java Dependency Injection (CDI), which allows you to easily find beans with certain annotations. What follows is a simple example that finds all @Stateless beans that have @Remote interfaces and automatically exposes those beans as remote hessian objects.

To learn more go to our wiki for Resin 4 Java EE WebProfile application server.

Posted in Uncategorized | No Comments »

Integrating with Resin REST: Graphs

March 7th, 2012 by alex

I’ve added a cookbook that demonstrates how to create a Graph using Resin REST and flot graph plotting library. The sample php file works with Resin-Pro-4.0.26.

wiki: Application Server: REST Graphing

The sample page requires jquery.flot.js. You can copy the files from doc/admin/flot located in Resin distributable.

Posted in Uncategorized | No Comments »

PHP with CGI and FastCGI

February 3rd, 2012 by Paul Cowan

I’ve added 2 cookbooks to the Resin 4 Wiki demonstrating Resin’s capability to execute scripts via CGI and FastCGI.

  • wiki: Native PHP With CGIServlet
  • wiki: Native PHP With FastCGIServlet
  • The example use PHP as the CGI executable, but they can be easily adapted to any CGI script.

    Of course Resin includes Quercus, a 100% pure Java PHP interpreter. These examples demonstrate how to execute the native PHP interpreter without the need for Apache.

    I also included instruction on setting up WordPress with CGI and FastCGI.

    Posted in Uncategorized | No Comments »

    Resin Custom URL Rewriting

    January 25th, 2012 by ferg

    I added a new cookbook to create a custom URL rewrite rule.

    wiki: Resin Application Server: Custom Rewrite Rules

    Resin’s URL rewriting is similar to Apache’s mod_rewrite, using regexp matching and the CDI XML syntax for built-in rules like resin:Redirect, resin:MovedPermanently and resin:Dispatch. In addition to the build-in rules, you can create your own custom rules for more sophisticated
    URL management. This wiki cookbook gives a quick example of one of those rules.

    Posted in Uncategorized | No Comments »

    Resin Clustered Application Server Configuration

    January 19th, 2012 by ferg

    A new cookbook showing the new parameterized configuration for resin.xml. The resin.xml can now import a properties file and use the properties as EL expressions like ${http} to create clean configurations. The example shows a simple, but complete cluster of three Resin servers acting as http servers, including the health system.

    wiki4: Resin Application Server: Parameterized Web Server Cluster

    Posted in Uncategorized | No Comments »

    Resin Messaging: CDI and JMS configuration

    January 13th, 2012 by ferg

    Another cookbook at wiki4: Resin Messaging: JMS Topic Configuration with CDI and JNDI as requested by a customer.

    The cookbook will be interesting if you want to see a relatively-complicated Resin CDI configuration which includes JNDI for the purpose of Spring integration, and also showing how custom facades can be combined with a standard JMS Topic configuration.

    Posted in Uncategorized | No Comments »

    WebSocket and Hessian

    January 12th, 2012 by ferg

    I’ve added a wiki cookbook on Resin WebSockets and Hessian.

    wiki4: Resin Messaging: WebSockets with Hessian

    Note, that this is a binary websocket protocol, so it would be used with a custom websocket client, not a browser. Since the browsers currently prefer speaking text websockets, the equivalent would be a JSON server.

    Posted in Uncategorized | No Comments »

    Resin Web Server: Using URL Write to Forbid non-SSL Requests

    January 11th, 2012 by ferg

    As a request from a user, I’ve written up a short wiki cookbook for Resin 4.0’s URL rewrite for a security rule to require SSL for a section of a website.

    Wiki: Resin Web Server: URL Rewrite Forbidding non-SSL Requests

    The example is pretty simple, since it just needs the as the action rule, and a single predicate, to test the request. Because it’s simple, it’s a good introductory example of Resin’s URL rewriting for people who haven’t looked into it yet.

    Posted in Uncategorized | No Comments »

    javax.cache and CDI

    January 5th, 2012 by ferg

    I’ve written up a quick how-to for configuring a Resin jCache ClusterCache and injecting it with CDI. The application code uses standard classes and CDI annotations and uses the Resin jCache implementation.

    http://wiki4.caucho.com/Resin_Java_Cache_using_CDI_Inject

    Posted in Uncategorized | No Comments »

    Hessian2Output streaming

    January 3rd, 2012 by ferg

    When you’re using Hessian in a streaming environment like WebSockets, you can improve performance by saving the serialization reflection and reusing the input and output streams.

    See http://wiki4.caucho.com/Hessian_Performance_OutputStream for a short cookbook example.

    Posted in Uncategorized | No Comments »

    « Older Entries

    Caucho Technology is proudly powered by WordPress and Quercus®
    Entries (RSS) and Comments (RSS).

    • HOME |
    • CONTACT US |
    • DOCUMENTATION |
    • BLOG |
    • WIKI 4 |
    • WIKI 3 |
    • Resin: Java Application Server
    Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
    caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.
    resin® is a cloud optimized, java® application server that supports the java ee webprofile ®