Summary

In this chapter, we introduced the use of interceptors and decorators in CDI, including how they are enabled within beans.xml of a bean archive.

For interceptors, we explained what a binding type was and how it supported inheritance. We also covered how to use binding and @Nonbinding members of an interceptor binding type, and how different interceptor binding types can be combined on bean types and methods.

We saw a situation in which a decorator is suited to solve a business problem, how to specify that a class implementing a bean type is a decorator, and what delegate object is injected into the decorator.

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.