SpringBootでコンテナ管理しているオブジェクトの一覧を取得する方法です。
本当はApplicationContextからメソッド経由で参照したいけど、とりあえずDebugモードで値を確認しています。
オブジェクトを管理しているクラス
org.springframework.beans.factory.support.DefaultListableBeanFactory
このクラスで適当にブレークポイントを打って、「beanDefinitionNames」の値を確認します。
| # | Bean名 |
|---|---|
| 0 | org.springframework.context.annotation.internalConfigurationAnnotationProcessor |
| 1 | org.springframework.context.annotation.internalAutowiredAnnotationProcessor |
| 2 | org.springframework.context.annotation.internalRequiredAnnotationProcessor |
| 3 | org.springframework.context.annotation.internalCommonAnnotationProcessor |
| 4 | org.springframework.context.annotation.internalPersistenceAnnotationProcessor |
| 5 | org.springframework.context.event.internalEventListenerProcessor |
| 6 | org.springframework.context.event.internalEventListenerFactory |
| … |