This question was because I heard about some integration that allows to use spring's annotations inside CDI beans.
I've been trying to replicate the spring's
@Value annotation behaviour within a CDI environment using
custom annotations, producer methods and custom qualifiers but I haven't been able to reproduce it.
I ended up doing as follows :
- Creating a custom CDI bean (via producer method) of type Properties decorated with a custom Qualifier ;
- Inject that custom qualified Properties Bean inside any CDI bean ;
- Populate Class member values inside the PostConstruct method.
It looks messy I know. Any ideas on how to make this cleaner?
Thanks in advance