Java Platform, Enterprise Edition (Java EE) 8 The Java EE Tutorial

## 29 Running the Advanced Contexts and Dependency Injection Examples

This chapter describes in detail how to build and run several advanced examples that use CDI.

The following topics are addressed here:

- Building and Running the CDI Advanced Examples

- The encoder Example: Using Alternatives

- The producermethods Example: Using a Producer Method to Choose a Bean Implementation

- The producerfields Example: Using Producer Fields to Generate Resources

- The billpayment Example: Using Events and Interceptors

- The decorators Example: Decorating a Bean

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.