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 configuration deploy devoxx eclipse ejb embedded flash flex google app engine hessian hmtp ioc java ee 6 javaone javazone jms messaging 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
« JSR-299 (CanDI) Proposed Final Draft
Why OSGi is cool, but not for most enterprise apps… »

CanDI (JSR-299) binding pattern tutorial

I’ve put together a CanDI binding pattern tutorial (pdf) for four major binding patterns: services, resources, startup, and plugin/extensions.

Focusing on common CanDI patterns should show how CanDI is used in full applications like SubEtha maillist manager, and avoid the temptation to focus on complicated features that only 1% of applications would ever need.

In the tutorial, the key CanDI classes are:

  • @Current - the service and unique bean binding annotation.
  • @BindingType - the resource custom binding annotation used for declarative injection.
  • Instance<T> - the extension/plugin iterator and programmatic bean factor.
  • @Any - the special annotation for extension/plugin matching of any registered beans

Tags: candi, jsr-299, tutorial

This entry was posted on Monday, June 15th, 2009 at 11:41 am and is filed under Engineering. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

4 Responses to “CanDI (JSR-299) binding pattern tutorial”

  1. latchkey Says:
    June 28th, 2009 at 10:36 am

    There is a tiny mistake in your pdf… under the heading “Plugin/Extension Pattern CanDI classes”, it mentions @All instead of @Any

  2. latchkey Says:
    June 28th, 2009 at 10:39 am

    “Any CanDI bean with a @Named annotation automatically becomes available to EL
    expressions as follows: ${myService.message}”

    Just curious, what if there is a naming conflict? For example someone does a ?

  3. latchkey Says:
    June 28th, 2009 at 10:40 am

    Darn, my example was stripped out.

    <c:set var=”myService” value=”foo” />

  4. ferg Says:
    June 29th, 2009 at 12:09 pm

    Thanks. I’ve changed the text (it’ll be updated on the site in a day or so.)

    For EL, if there’s a conflict, the EL will throw an exception when it’s evaluated, according to the spec. (I need to check if Resin’s properly handling that case.)

Leave a Reply

You must be logged in to post a comment.


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 ®