headstar / beans-graph Goto Github PK
View Code? Open in Web Editor NEWLibrary to create a graph of Spring bean dependencies
License: Apache License 2.0
Library to create a graph of Spring bean dependencies
License: Apache License 2.0
I'm happy to find this project because it will help for my use case and I'm thankful for that project.
I launch the base code at it prints correctly all the dependencies of my application :
import com.headstartech.beansgraph.BeansGraphProducer;
import com.headstartech.beansgraph.ConsoleReporter;
import com.headstartech.beansgraph.EnableBeansGraph;
import org.springframework.stereotype.Component;
@EnableBeansGraph
@Component
public class ConfigureBeanGraphReporters implements BeansGraphConfigurer {
@Override
public void configureReporters(BeansGraphProducer producer) {
ConsoleReporter.forSource(producer).build();
}
}
However, i want to have my own Reporter, therefore I create a class that implements BeansGraphListener
and I want to implement my logic in onBeanGraphResult
:
public class BeanGraphChecker implements BeansGraphListener {
@Override
public void onBeanGraphResult(ApplicationContext applicationContext, BeansGraphResult result) {
checkBeanDependencies(applicationContext, result);
}
private void checkBeanDependencies(ApplicationContext applicationContext, BeansGraphResult result) {
UnmodifiableDirectedGraph<Bean, DefaultEdge> graph = result.getDependencyGraph();
// Implement my logic on the graph here
}
}
However, that code does not compile because the Bean class is package protected and not public.
I tried to hack by moving the class to the com.headstartech.beansgraph; package, but I get a runtime error this time.
How am I suppose to use/extend the library when I cannot accessing the Bean class ?
I could fork the project to change the source code but currently I only need that little change.
The Bean class was public and was changed to package since commit d72147, what was the reason to change the visibility at the time ?
Thanks for reading my problem :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.