Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Scope of Aspect Defined in Fragment
Scope of Aspect Defined in Fragment [message #495337] Wed, 04 November 2009 15:40 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: July 2009
Junior Member
Hi there,

in an Eclipse-RCP application I have defined an aspect in a fragment and want it to match joinpoints in the the fragment host bundle. This, however does not seem to work. If I move the aspect to the host bundle, everything works fine. Both host and fragment have an aspectj nature. Now I wonder if this is a principal limitation or if I got something wrong.

For those interested - the context is the following: I keep the JUnit tests for the host bundle in the fragment. The RCP application makes heavy use of jobs and this quite often causes trouble in unit tests, because some tests depend on the result of jobs and I have to artificially make them wait for the jobs to finish. So I thought, I could write an aspect which matches the Job.schedule() method and uses an around advice to block this method and instead run the Job in the main thread. This works fine, when the aspect is living in the host bundle (which again is bad because then it is deployed into the application unless I use ugly things like system properties to block/activate it).

Thanks for any help Smile
tarek
Re: Scope of Aspect Defined in Fragment [message #496393 is a reply to message #495337] Mon, 09 November 2009 20:57 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
In order to make weaving work in an OSGi environment, you need to use Equinox Aspects. This is because the dynamic nature of Eclipse requires aspects that apply across bundles be applied at load time.

See here for a description of how EA works:
http://www.eclipse.org/equinox/incubator/aspects/index.php

EA is included with the distribution of AJDT.
Re: Scope of Aspect Defined in Fragment [message #600727 is a reply to message #495337] Mon, 09 November 2009 20:57 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
In order to make weaving work in an OSGi environment, you need to use Equinox Aspects. This is because the dynamic nature of Eclipse requires aspects that apply across bundles be applied at load time.

See here for a description of how EA works:
http://www.eclipse.org/equinox/incubator/aspects/index.php

EA is included with the distribution of AJDT.
Previous Topic:ITD scope
Next Topic:Error when running the aspectj book examples
Goto Forum:
  


Current Time: Wed Sep 25 05:37:09 GMT 2024

Powered by FUDForum. Page generated in 0.02508 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top