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
Kristian,
have you tried AspectJ? It is actually quite easy to write an aspect which can
do that for you.
--
Alexander Kriegisch
Kristian Rosenvold schrieb am 02.04.2014 09:32:
> I've been wondering if there exists a java tool that would let me graph
> classloading, so that I can track stuff
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
be
>>> able to work with you on it? Is it something others are going to be able
>>> to quickly understand and modify/improve?
>>>
>>> And I need to emphasise again that there is already some code around
>>> that is trying to address this: the discov
k with you on it? Is it something others are going to be able
to quickly understand and modify/improve?
And I need to emphasise again that there is already some code around
that is trying to address this: the discovery and reports components of
the repository manager, and the graphing plugin at mo
e repository manager, and the graphing plugin at mojo.codehaus.org.
How do these relate to the tasks?
I don't mean to discourage it - if you've got an itch, by all means
scratch it and we'll sort it out in the end. Just trying to give the
best chance of being able to reuse it later
that there is already some code around
that is trying to address this: the discovery and reports components of
the repository manager, and the graphing plugin at mojo.codehaus.org.
How do these relate to the tasks?
I don't mean to discourage it - if you've got an itch, by all means
scrat