Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to graphically view the dependencies in spring application context file

i have a few application context files for an application. I want to view graphically the dependencies between them.

Is there a free plugin in eclipse or some viewer?

Thanks!

like image 732
Inv3r53 Avatar asked Nov 10 '11 14:11

Inv3r53


People also ask

How do I get Spring application context?

To get a reference to the ApplicationContext in a Spring application, it can easily be achieved by implementing the ApplicationContextAware interface. Spring will automatically detect this interface and inject a reference to the ApplicationContext: view rawMyBeanImpl. java hosted by GitHub.

How do you find the Spring context of a web application?

We use the FileSystemXMLApplicationContext class to load an XML-based Spring configuration file from the file system or from URLs. This class is useful when we need to load the ApplicationContext programmatically.

What is application context file in Spring?

ApplicationContext is a corner stone of a Spring Boot application. It represents the Spring IoC container and is responsible for instantiating, configuring, and assembling the beans. The container gets its instructions on what objects to instantiate, configure, and assemble by reading configuration metadata.

How do I find application context?

You can go for getApplicationContext() if you wanna get context of whole application. If you want to get context of current class you can use getBaseContext() instead.


2 Answers

The Spring Tool Suite has an editor (Spring Config Editor) to edit the spring context xml files. This Editor can also draw a diagram of the beans (the tab "Beans Graph" of that editor -- see the image below.).

When I remember right, then this functionality is also included in the Eclipse Spring IDE Plugin.


"Beans Graph" of "Spring Config Editor" in STS

like image 72
Ralph Avatar answered Oct 10 '22 08:10

Ralph


There's also the Spring Bean Doc project, although it's a bit long-in-the-tooth. I have not used it with Spring 3, so I can't speak for its efficacy for recent versions.

like image 25
Dave Newton Avatar answered Oct 10 '22 10:10

Dave Newton