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

Posts Tagged ‘ioc’

Servlet 3.0 Tutorial: @WebListener, @WebServlet, @WebFilter and @WebInitParam

Tuesday, October 6th, 2009

Resin 4.0 introduced Early Access Servlet 3.0 support and, in version 4.0.2, we’ve solidified the implementation. Among many interesting features, Servlet 3.0 introduces annotations that make deploying Servlets, Filters and Listeners of all types easier. This short tutorial opens with the introduction of annotations of javax.servlet.annotation package, shows how to use WebListener, WebServlet, WebFilter and WebInitParam annotations and closes with an example demonstrating a use of IOC (javax.inject package) in a Servlet.
(more…)

Tags: @WebFilter, @WebInitParam, @WebListener, @WebServlet, Inject, ioc, Servlet 3.0
Posted in Engineering | No Comments »

Resin 4.0 rewrite/dispatch

Wednesday, April 8th, 2009

Because Resin 4.0 can now use Java Injection (JSR-299) for its configuration, we’ve taken advantage of the new syntax to redesign Resin’s rewrite and dispatch capabilities, used for sites migrating from Apache’s mod_rewrite module. The admin documentation is at http://caucho.com/resin/admin/rewrite.xtp and the JavaDoc for the tags is at com.caucho.rewrite (the JavaDoc describes the tags because Resin-rewrite uses Java Injection - JSR-299 for configuration.)

Rewrite matches HTTP URLs with a regular expression and dispatches them to servlets or load-balancing or HTTP proxies or HTTP redirects. PHP applications like MediaWiki and Drupal use rewriting to present pretty URLs to the world, but use /index.php internally.

(more…)

Tags: ioc, resin 4.0, rewrite
Posted in Engineering | 2 Comments »

Java CanDI (JSR-299 Injection)

Wednesday, January 28th, 2009

Resin CanDI

The latest draft of JSR-299 for Java Injection is now available, and we’ve been madly repackaging and renaming our test cases to follow. The biggest change is the name of the spec: Java Contexts and Dependency Injection (Java CanDI), instead of the old WebBeans. (The image at the right is supposed to be a Resin lollipop.)

Along with a new Resin 4.0 snapshot, I’ve done a quick pass at the Resin Injection documentation
and updated the JavaDoc.

A quick overview of the new packaging and examples follows:
(more…)

Tags: candi, core, injection, ioc, resin
Posted in Engineering | 3 Comments »

Embedded Resin… with WebBeans!

Friday, April 11th, 2008

One of the coolest new features of Resin 3.1.5 is embedding. Basically with a few simple lines of code, you can embed Resin into any existing Java application. More than that though, you can take advantage of Resin IoC/WebBeans even within the embedded environment. Let me give you an example…

Let’s start with simple embedding:

package demo;

import com.caucho.resin.*;

public class EmbeddedResin {
  public static void main(String[] args)
    throws Exception
  {
    ResinEmbed resin = new ResinEmbed();
    HttpEmbed http = new HttpEmbed(8080);
    resin.addPort(http);

    resin.addWebApp(new WebAppEmbed("/", "ROOT"));
    resin.start();
    resin.join();
  }
}

This basically starts up a new Resin within this application listening to port 8080 and serving up a webapp whose root is at “ROOT”. The resin.start() call starts the instance while the resin.join() waits for it to finish. Depending on the application, you may want to separate those calls.

So that’s very cool, but now what if I have a bean that I want to inject somewhere. Let’s say this FooBean:

package demo;

public class FooBean {
  public String hello()
  {
    return "Hello from the world of Embedded Resin!";
  }
}

I can actually do annotation based injection into a JSP for example:

<%@ page import="javax.webbeans.*,demo.*" %>
<%! @In private FooBean _foo; %>

<%= _foo.hello() %>

All I have to do is add a call to resin.addBean() to the example above:

package demo;

import com.caucho.resin.*;

public class EmbeddedIoC {
  public static void main(String[] args)
    throws Exception
  {
    ResinEmbed resin = new ResinEmbed();
    HttpEmbed http = new HttpEmbed(8080);
    resin.addPort(http);

    resin.addBean(new BeanEmbed(new FooBean()));

    resin.addWebApp(new WebAppEmbed("/", "ROOT"));
    resin.start();
    resin.join();

  }
}

It’s pretty cool to me that you can drop a random bean into the embedded Resin, then just have it show up somewhere in a JSP. :-) I bundled this example up here. Just run “ant compile”, then “ant run” to use it.

Tags: embedded, ioc, resin, webbeans
Posted in Engineering | No Comments »

Resin 3.1.5 released!!!

Wednesday, February 27th, 2008

Woohoo! I’m pretty excited about this one. There are so many new cool features. Here’s the list:

  • Resin IoC - Fully WebBeans (JSR-299) compliant IoC container
  • Embedded Resin - Use Resin in an existing application or within a unit testing framework like JUnit.
  • Support for gobs of 3rd-party packages: Maven2, Ivy, Mule, Struts2, CXF, Wicket, and more!
  • Lots of updates to security, including an update to the authenticator configuration
  • Exposure of the Resin JMS queues as BlockingQueues
  • Watchdog updates
  • Security updates
  • Resin remoting

Wow… there are a lot of features there. I was going to write a bigger entry to cover everything, but I think now that it would be better if I split it up. Over the next few days, I’ll be writing more in depth entries about each of these features. It’ll probably take a week… :-)

Tags: embedded, ioc, jms, messaging, remoting, resin, watchdog
Posted in Announcements | No Comments »


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 ®