O'Reilly logo

EJB 3 in Action, Second Edition by Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Using CDI with EJB 3

This chapter covers

  • Dependency injection for POJOs
  • Scopes and bean lifecycles
  • Core CDI constructs
  • Long-running conversations

Context and Dependency Injection (CDI) is an exciting new feature that was introduced with Java EE 6 and further extended in Java EE 7. CDI brings full-fledged dependency injection and context support to the Java EE platform. In earlier chapters you saw examples of resource injection using @PersistenceUnit, @Resource, and @EJB to inject resources as well as other EJBs. We’ve also delved into interceptors that provide basic AOP support. These powerful features, along with other innovations including JPA, have greatly simplified Java EE development.

But the innovations that were introduced ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required