Home » Language IDEs » AspectJ » Load-Time weave only one single aspect of a project containing several aspects
Load-Time weave only one single aspect of a project containing several aspects [message #533825] |
Mon, 17 May 2010 08:25 |
Tassilo Horn Messages: 93 Registered: July 2009 |
Member |
|
|
Hi!
I use the AJDT 2.0.2.e35x with AspectJ 1.6.7 inside Eclipse 3.5.2.
There I have a project containing several different aspects I use for
inspecting some legacy java application.
Now, I'm developing a new aspect in that project, and in order to test
and debug it, I'm asking myself how to run the legacy application and
only weave in that single aspect?
I created a Run Configuration below "AsepctJ Load-Time Weaving
Application", and I've put the project containing the aspects into the
LTW Aspectpath. Unfortunately, this weaves in all aspects that are
contained in the project, and I cannot figure out how to teach it only
to use that one single aspect I'm currently interested in.
Any help?
Bye,
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
|
Re: Load-Time weave only one single aspect of a project containing several aspects [message #533838 is a reply to message #533825] |
Mon, 17 May 2010 09:17 |
Tassilo Horn Messages: 93 Registered: July 2009 |
Member |
|
|
Tassilo Horn <horn@uni-koblenz.de> writes:
> I created a Run Configuration below "AsepctJ Load-Time Weaving
> Application", and I've put the project containing the aspects into the
> LTW Aspectpath. Unfortunately, this weaves in all aspects that are
> contained in the project, and I cannot figure out how to teach it only
> to use that one single aspect I'm currently interested in.
I was able to manage this by commenting all aspects except that single
one in the aspectj project's META-INF/aop-ajc.xml. That works, but
doesn't feel right to me. Isn't there a better way?
BTW: Is it correct that I have to maintain META-INF/aop-ajc.xml on my
own? It seems that any changes I do to my aspects are not reflected in
it, and I have to update it manually (changing aspect names/files,
moving them in different packages, ...).
Bye,
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
|
Re: Load-Time weave only one single aspect of a project containing several aspects [message #534033 is a reply to message #533838] |
Mon, 17 May 2010 19:07 |
Andrew Clement Messages: 162 Registered: July 2009 |
Senior Member |
|
|
Hi,
> I was able to manage this by commenting all aspects except
> that single one in the aspectj project's META-INF/aop-ajc.xml.
> That works, but doesn't feel right to me. Isn't there a better way?
so you have commented out the source for all the aspects you don't want to include - you don't mean you have commented out the entries in the aop xml file for those you don't want to include?
And your launch configuration is for the one single project that contains all the code and the aspects? If that project is an AspectJ project, all your aspects will be getting woven in during project build. Whatever the launch configuration does, it will still find those aspects are woven into the code that is running.
There are a couple of things you can try.
1) In the project AspectJBuild>aop.xml management page, you can specify an aop.xml file that controls compilation. This can list the aspects that should be used during the build (this is entirely separate to load time weaving). It uses the same format as the regular aop.xml. So just add an aop.xml that includes your single aspect.
2) You can scope the aspects in your ltw aop.xml file. this means adding a scope to the aspect declaration lines <aspect name="Foo" scope="within(*)"/>. If you make that scope !within(*) for the aspects you don't want to apply, that will probably exclude them during ltw.
(1) is very experimental, (2) is slightly less experimental
> BTW: Is it correct that I have to maintain META-INF/aop-ajc.xml on my
> own? It seems that any changes I do to my aspects are not reflected in
> it, and I have to update it manually (changing aspect names/files,
> moving them in different packages, ...).
If you have 'outxml' set for the project (it is a project preference) then an aop.xml file will be generated on each compile. However, it will not preserve any edits you have made to it - we don't support that way of working right now.
Andy
|
|
| |
Re: Load-Time weave only one single aspect of a project containing several aspects [message #600982 is a reply to message #533825] |
Mon, 17 May 2010 09:17 |
Tassilo Horn Messages: 93 Registered: July 2009 |
Member |
|
|
Tassilo Horn <horn@uni-koblenz.de> writes:
> I created a Run Configuration below "AsepctJ Load-Time Weaving
> Application", and I've put the project containing the aspects into the
> LTW Aspectpath. Unfortunately, this weaves in all aspects that are
> contained in the project, and I cannot figure out how to teach it only
> to use that one single aspect I'm currently interested in.
I was able to manage this by commenting all aspects except that single
one in the aspectj project's META-INF/aop-ajc.xml. That works, but
doesn't feel right to me. Isn't there a better way?
BTW: Is it correct that I have to maintain META-INF/aop-ajc.xml on my
own? It seems that any changes I do to my aspects are not reflected in
it, and I have to update it manually (changing aspect names/files,
moving them in different packages, ...).
Bye,
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
|
Re: Load-Time weave only one single aspect of a project containing several aspects [message #600989 is a reply to message #533838] |
Mon, 17 May 2010 19:07 |
Andrew Clement Messages: 162 Registered: July 2009 |
Senior Member |
|
|
Hi,
> I was able to manage this by commenting all aspects except
> that single one in the aspectj project's META-INF/aop-ajc.xml.
> That works, but doesn't feel right to me. Isn't there a better way?
so you have commented out the source for all the aspects you don't want to include - you don't mean you have commented out the entries in the aop xml file for those you don't want to include?
And your launch configuration is for the one single project that contains all the code and the aspects? If that project is an AspectJ project, all your aspects will be getting woven in during project build. Whatever the launch configuration does, it will still find those aspects are woven into the code that is running.
There are a couple of things you can try.
1) In the project AspectJBuild>aop.xml management page, you can specify an aop.xml file that controls compilation. This can list the aspects that should be used during the build (this is entirely separate to load time weaving). It uses the same format as the regular aop.xml. So just add an aop.xml that includes your single aspect.
2) You can scope the aspects in your ltw aop.xml file. this means adding a scope to the aspect declaration lines <aspect name="Foo" scope="within(*)"/>. If you make that scope !within(*) for the aspects you don't want to apply, that will probably exclude them during ltw.
(1) is very experimental, (2) is slightly less experimental
> BTW: Is it correct that I have to maintain META-INF/aop-ajc.xml on my
> own? It seems that any changes I do to my aspects are not reflected in
> it, and I have to update it manually (changing aspect names/files,
> moving them in different packages, ...).
If you have 'outxml' set for the project (it is a project preference) then an aop.xml file will be generated on each compile. However, it will not preserve any edits you have made to it - we don't support that way of working right now.
Andy
|
|
| |
Goto Forum:
Current Time: Thu Mar 28 09:40:06 GMT 2024
Powered by FUDForum. Page generated in 0.03554 seconds
|