Contexts and Dependency Injection (CDI) is a powerful dependency injection mechanism that is part of both the Jakarta EE and MicroProfile specifications. CDI allows us to easily inject dependencies into our code; it also has an event handling mechanism that allows us to loosely couple different parts of our code. In this chapter, we will see how we can incorporate CDI into our MicroProfile applications deployed to Payara Micro.
CDI Scopes
CDI beans have scopes, which denote their life cycle; a bean’s ...