Reputation: 30097
Is it possible to know bean's name from @Bean
-annotated method and put it into this same bean's property, so that bean knows its own name?
If this way is impossible, then if there another way exist?
Upvotes: 2
Views: 169
Reputation: 9159
Yes, there is the interface BeanNameAware which should be implemented by your bean.
Upvotes: 3