Hello,

I am trying to instrument classes at load time and I thought about using 
WeavingAdaptor. 

I use my own agent, to perform other types of analysis on the bytecode. Thus I 
would like to use the load-time facilities offered by AspectJ out of their 
normal context. I searched a bit and I found WeaverAdapter. However, what is 
not clear to me is how to use it. Could someone point me to a tutorial, 
example, etc?

I would like to ask what is the GeneratedClassHandler for? Also, do I need to 
pass to the WeaverAdapter the entire classpath for the classes, since I already 
have the bytes of the class I want to instrument?

Also, for the URLs for the aspects, do these have to point to an .aj file? or a 
compiled version? I tried with the ".aj" files but no success.

This is the log of my actions:

20:50:27.044 main I [WeavingAdaptor] info using aspectpath: []
20:50:27.104 main > org.aspectj.weaver.Lint.<init>
org.aspectj.weaver.l...@59bca5f1
org.aspectj.weaver.bcel.bcelwo...@70329f3d
20:50:27.104 main < org.aspectj.weaver.Lint.<init>
20:50:27.104 main > org.aspectj.weaver.World.<init>
org.aspectj.weaver.bcel.bcelwo...@70329f3d
20:50:27.108 main > org.aspectj.weaver.Dump.registerNode class
org.aspectj.weaver.bcel.BcelWorld,
org.aspectj.weaver.bcel.bcelwo...@70329f3d
20:50:27.108 main < org.aspectj.weaver.Dump.registerNode 1
20:50:27.137 main < org.aspectj.weaver.World.<init>
20:50:27.159 main > org.aspectj.weaver.bcel.ClassPathManager.<init>
org.aspectj.weaver.bcel.classpathmana...@3dac2f9c
java.util.LinkedList(37),
org.aspectj.weaver.tools.weavingadaptor$weavingadaptormessagehol...@7369ca65
20:50:27.183 main I [WeavingAdaptor] info directory classpath entry
does not exist: /usr/share/java/junit4-4.3.1.jar
20:50:27.183 main I [WeavingAdaptor] info directory classpath entry
does not exist: /usr/share/java/junit4.jar
20:50:27.184 main I [WeavingAdaptor] info directory classpath entry
does not exist: /usr/share/java/junit.jar
20:50:27.184 main I [WeavingAdaptor] info directory classpath entry
does not exist: /usr/local/lib/pl-5.6.64/lib/jpl.jar
20:50:27.184 main I [WeavingAdaptor] info zipfile classpath entry does
not exist: /home/slv/Desktop/no_X11/PSet
20:50:27.185 main I [WeavingAdaptor] info zipfile classpath entry does
not exist: /home/slv/Desktop/aspectj-1.6.6/aspectjweaver
20:50:27.185 main I [WeavingAdaptor] info zipfile classpath entry does
not exist: /home/slv/Desktop/aspectj-1.6.6/aspectjweaver
20:50:27.186 main < org.aspectj.weaver.bcel.ClassPathManager.<init>
20:50:27.205 main > org.aspectj.weaver.bcel.BcelWeaver.<init>
org.aspectj.weaver.bcel.bcelwea...@4d61f10f
org.aspectj.weaver.bcel.bcelwo...@70329f3d
20:50:27.205 main < org.aspectj.weaver.bcel.BcelWeaver.<init>
20:50:27.205 main > org.aspectj.weaver.bcel.BcelWeaver.prepareForWeave
org.aspectj.weaver.bcel.bcelwea...@4d61f10f
20:50:27.211 main < org.aspectj.weaver.bcel.BcelWeaver.prepareForWeave



20:50:33.490 main > org.aspectj.weaver.tools.WeavingAdaptor.weaveClass
org.aspectj.weaver.tools.weavingadap...@7d15d06c test.Test, byte[731]
20:50:33.491 main ? [WeavingAdaptor] debug weaving 'test.Test'
20:50:33.633 main > org.aspectj.weaver.bcel.BcelWeaver.weave
org.aspectj.weaver.bcel.bcelwea...@4d61f10f
org.aspectj.weaver.tools.weavingadaptor$weavingclassfileprovi...@64bef361
20:50:33.641 main > org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify
org.aspectj.weaver.bcel.bcelwea...@4d61f10f
org.aspectj.weaver.bcel.unwovenclassf...@4c2b349d,
org.aspectj.weaver.bcel.bcelobjectt...@288b567c,
org.aspectj.weaver.tools.weavingadaptor$weavingclassfileprovide...@53dafbaf
20:50:33.647 main < org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify
20:50:33.647 main < org.aspectj.weaver.bcel.BcelWeaver.weave
java.util.ArrayList(1)
20:50:33.647 main < org.aspectj.weaver.tools.WeavingAdaptor.weaveClass byte[731]


Thank you in advance for your help!

Best regards,
        Silviu_______________________________________________
aspectj-users mailing list
aspectj-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to