LoginSignup
1
3

More than 5 years have passed since last update.

SpringBootでコンテナ管理しているオブジェクトの一覧を取得する方法

Posted at

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

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3