Code Labs

Contexts and Dependency Injection (CDI)

Optional Bean Reference Injection

Springs @Autowired annotation supports optional bean injection (required=false). If you want to simulate a similar behaviour with CDI you must inject an instance of the optional bean and check its availability.