You can create an agent that will has a method that will notify you when a class is about to be loaded where you can analyze or mutate the class. You could build the graph dynamically. A decent introduction that I looked at a while ago:
http://blog.javabenchmark.org/2013/05/java-instrumentation-tutorial.html On Apr 2, 2014, at 3:32 AM, Kristian Rosenvold <kristian.rosenv...@gmail.com> wrote: > I've been wondering if there exists a java tool that would let me graph > classloading, so that I can track stuff like "this class is being used only > through this library" and that might even be able to give me what-if > analysis of what would happen if I replaced that specific dependency with > another alternative. I am thinking about the run-time class loading here, > not really static analysis. > > I am assuming some kind of instrumentation of the linking phase of > classloading, not even sure it's possible... ? > > (I know this is slightly off-topic, but it would certainly be applicable to > making some plugins faster) > > Kristian Thanks, Jason ---------------------------------------------------------- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl http://twitter.com/takari_io --------------------------------------------------------- Selfish deeds are the shortest path to self destruction. -- The Seven Samuari, Akira Kurosawa