Reputation: 2416
How can I get a list of all active @Configuration beans from an application context so I can list them at startup?
Upvotes: 1
Views: 134
Reputation: 5968
You can call the application context and ask it by all beans annotated with @Configuration
annotation, make sure you call once only the ApplicationContext
instance, and not call it several times, then you can ask by beans with that annotation by following this:
Map<String, Object> beans = applicationContext.getBeansWithAnnotation(Configuration.class);
Upvotes: 1