This question already has an answer here:
I am doing some refactoring and reviewing of the application that we are currently developing. While doing this I found that more beans are injected and I think making they loading in an lazy manner would be better suited for their purpose. I am using Java EE 6 and tend to use more CDI than EJB injection.
So the question is whether it is possible to inject the beans lazily and if so, how can you do it?
What about using
?
That allows Getting instance of "?" when actually needed via