I have a spring config where I define hundreds of actions which extend MyAction
. I have a pool where an execution service can look up actions. I can't use the appContext directly because each action has one or more "keys" which the execution service will use and pool cuts that dependency.
So the pool must be able to collect all beans of type MyAction
(or rather beans that extend MyAction
).
The method ApplicationContext.getBeansOfType()
seems to do what I need but when can I safely call it?
It would be great if I could call it in a @PostConstruct
method but is it guaranteed that the bean factory has seen added each and every bean from the config at that time?
Note: Almost all of my beans are @Lazy