Caucho home of Resin DevOps friendly, cloud optimized, Java EE, Java Application Server that supports Servlets, JMS, JCache, Distributed Caching, and Java Monitoring

  • Home
  • Resin
  • Resin Web Server
  • Documentation
  • Forum
  • Projects
  • Company
  • Online Store
  • Download
  • web profile
  • health
  • cloud
  • resin pro
  • price list
  • candi
  • integration
  • press
  • newsletter
  • cache
  • queue




    • products

    • resin 4.0
    • resin 3.1
    • resin 3.0
    • quick links

    • getting started
    • changes


    •  
    • hessian
    • quercus (php)
    • resin topics

    • admin
    • clustering
    • database
    • deployment
    • logging
    • security
    • full web server
    • health
    • follow us!

    • Follow cauchoresin on Twitter

Java CDI | CanDI - Java Injection (JSR-299) for Resin

The Resin 4 core and configuration is built around the Java EE standard CDI dependency injection. Every Resin configuration from the resin.xml to resin-web.xml uses CDI as its configuration engine. CanDI is Resin’s implementation of Java CDI and it is core to Resin 4 Java Application Server.

With CanDI, your own applications can be clearly structured for testing, development, and maintenance as encouraged by the clean design CDI encourages.

The CDI community-designed extensions have become a key shared resource for Java developers, reusing design patterns created by other developers solving the same problems.

The custom, typesafe binding annotations are key to CDI’s self-documentation, because injection points clearly describe the resources or services they expect with adjective-oriented annotations. The annotations are true Java classes; they are documented in JavaDoc and verified by the compiler. Because the binding annotations are a small number of meaningful adjectives, they don’t impose a significant coding burden, and are well worth the small extra development time.



  • standard: JavaEE Web Profile standard ensures compatibility between implementations, frameworks, applications, and IDEs.
  • compact: the standards process keeps CDI well-defined, complete and compact.
  • safe: compiler type-safe checking validates code correctness.
  • clean: annotation processing keeps code focused and configuration tidy.
  • flexible: minimal XML focuses on needed configuration, leaving boilerplate connections for auto-injection.
  • powerful: interceptors, decorators and a typed event system fill out a complete feature set.
  • extensible: standard extension framework gives library developers the space to experiment with features.

Learn more about CanDI and Java CDI

Documentation

  • Java CDI | CanDI XML configuration for Administrators
  • Java Injection Pattern Tutorial (pdf)

Whitepapers

  • CDI Dependency Injection - An Introductory Tutorial Part 1 (pdf)
    JavaLobby Article by Rick Hightower
  • CDI Dependency Injection - Annotation Processing and Plugins Tutorial Part 2 (pdf)
    JavaLobby Article by Rick Hightower

Benefits and Features

Self-Documenting Injection

  • Describes dependencies with custom annotation bindings.
  • Type-safe, application-centric bindings.
  • Discovers services and components with automatic classpath scanning.
  • Integrates with JSP and JSF expressions @Named annotations.
  • Supports advanced interception and event handling.

Lightweight XML

  • Needed only for customization; default wiring doesn’t need XML
  • Type-safe, customizable XML, using namespaces to map Java packages to tags
  • Powerful configuration of Java instances, including sub-bean configuration
  • Used by Resin for all Resin configuration

JavaEE Integration

  • Usable from servlets, filters, EJBs, and JSF managed beans
  • Integrated with JavaEE scopes (session, request, application)
  • Deploy managed beans through servlet WEB-INF and JavaEE-visible jars
  • Cross-fertilized aspects from EJBs: transactions, interception, security, locking

Service Centered Design

  • Centralized registration and lookup.
  • Uniform lifecycle management.
  • Self-documented service declaration and binding.
  • Automatic discovery and wiring.
  • HOME |
  • CONTACT US |
  • DOCUMENTATION |
  • BLOG |
  • WIKI
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 ®