I use AspectJ to track calls to the graphics class. So far, I have used the pre-woven set of javax.swing classes. *, And at boot, I tell the JVM to use these woven classes, not the ones from the JRE, using the -Xbootclasspath / p switch.
I would like to switch to weaving mode at boot time. Can anyone help me how to weave javax.swing at boot time. I searched the network, but still I canβt figure out how to do this. I know that by default, AspectJ load time weaver will not weave java. * And javax. * Classes. Someone suggested using
-Xset: weaveJavaPackages = true, weaveJavaxPackages = true
in aop.xml, but none of this helped because the javax.swing classes are loaded before the weaver is attached to the classloader. I think that the weaver does not see these classes at all.
How can I dynamically bind javax.swing classes? Should I implement a custom classloader that first registers the weaver and then loads the class?
Can anyone suggest any solution?
Gonny source share