Chapter 8. Writing a Portable Extension

As CDI was never intended to be a stationary target, only being enhanced and updated as part of a JSR, a series of SPIs (Service Provider Interfaces) are exposed by CDI so that developers like us can extend and enhance CDI through portable extensions.

We'll look at how to create a portable extension, what is the container lifecycle and how it can be utilized in creating additional functionality in CDI, how we can consume CDI beans from non-CDI beans, and some example extensions to provide an idea of what can be achieved.

What is a portable extension?

A portable extension is a Java Service Provider that is retrieved during container startup by Weld and notified at each stage of the container lifecycle, based ...

Get JBoss Weld CDI for Java Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.