-1

Is there a way to find out bean creation order (or at least dependency order) after Spring context has been refreshed?

Just a simple order of bean definitions would do it. I dont want the order in which they were registered. I want the order in which they will be created (dependency tree)

kosta5
  • 1,129
  • 3
  • 14
  • 36
  • Check this question: https://stackoverflow.com/questions/29743320/how-exactly-works-the-spring-bean-post-processor – Ivan Jan 17 '18 at 23:54
  • https://www.youtube.com/watch?v=JfgP566BHW0 this video will answer your question in detail – Shenbo Jan 18 '18 at 00:48
  • Adding a postProcessor can resolve this. Not an awesome solution but works. – kosta5 Jan 20 '18 at 22:48

1 Answers1

0

Adding a postProcessor can resolve this. Not an awesome solution but works.

After context is up there is no way to find out in which order beans were crated. Unless you use spring-dependent external lib for finding out relationships between bean definitions.

kosta5
  • 1,129
  • 3
  • 14
  • 36