Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] On generating Aspectj code

Hi all,

I am working on a research project. Boradly, the project is just a
fancy logging application that  should log specified fields in
specified types at specified point cuts.  All the things that should
be specified are fed as an xml file to my python script which performs
the following tasks:

a) reads an XML file to construct the point cuts
b) for each of these point cuts I only need to log some specific data
for a specific type from the exposed context. I modify the advice to
log those specific parts along with the name of the join point using
thisJoinPoint.
c) finally all these generated strings are concatenated and written to
an aspectj file.
d) the generated aspectj file is used to instrument an existing application.

I have the following questions: I looked at the ltw-configuration
page[1] in the manual, but it didn't seem to answer these questions:

generating aspectj files:

1) Is there a better way to generate these aspectj files?
2) I saw that I can specify the point cuts using aop.xml file. But I
see that the aop.xml files are generated from the ajc. So, is it a
common practice to write aop.xml files? Are there any tutorials on how
to write aop.xml files?
3) Can I use aop.xml files to perform compile time weaving?
4) Can I specify advice in aop.xml file?
5) Also, can someone explain, the concrete and abstract aspects and
how all of it related to aop.xml files?

building projects:

6) The generated aspectj files, should be applied to random java
projects I download from internet. Is load time weaving the best way
to apply those aspects? I can't use compile time weaving since it
requires messing with the build files of those random java projects
which is hard. Can I implement ltw using command line options ( I use
makefiles, so this options is important)? What is the general way to
do things like this?

Performance:

7) During each point cut I need to log the name of the pointcut in the
file for which I am using thisJoinPoint. If I  generate a single
pointcut and advice for each of the functions I am interested in, will
it make my program any faster since thisJoinPoint is slow?

TIA,
-S-

[1] http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html


Back to the top