Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » How to apply an aspect to several plug-ins ?
How to apply an aspect to several plug-ins ? [message #1151723] Wed, 23 October 2013 14:57 Go to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 25
Registered: May 2010
Junior Member
Hi Everybody !

I want to use AspectJ with an Eclipse RCP application made of several plug-ins.
I have found different methods on the Web, but no one succeeded.
I am using Eclipse 3.7.2 and ApspectJ Development Tools 2.2.0 / AspectJ 1.7.0

The aspect purpose is to add tracing functionality to the application, showing when we enter and exit a function; it works fine on a plug-in when I insert my .aj file into this plug-in. The Aspect Visualization Perspective views show relationships between the aspect and the Java code (what a nice functionality !) and makes code navigation easy. During execution, I get trace information in the Console view.

Now I want to isolate the aspects plug-in from the other ones. Let's say that P1, P2 and P3 plug-ins make up my RCP application and AJ is my AspectJ plug-in. What should I do to trace execution of P1, P2, and P3 with aspects from AJ ?

Thanks a lot in advance for your time !

Georges
Re: How to apply an aspect to several plug-ins ? [message #1151831 is a reply to message #1151723] Wed, 23 October 2013 16:31 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 368
Registered: July 2009
Senior Member
Regular load time weaving will not work because of the way that OSGi containers load classes. In order to do this, you will need Equinox Weaving: http://eclipse.org/equinox/weaving/. This uses OSGi framework adapter hooks to do the loadtime weaving.

Alternatively, if you structure your code correctly, you can use compile time weaving, but then all your aspects must be available at compile time and you need to be careful about creating circular dependencies between bundles in this case.

In general, it's easier to use Equinox weaving.
Re: How to apply an aspect to several plug-ins ? [message #1154371 is a reply to message #1151831] Fri, 25 October 2013 06:42 Go to previous message
Georges Bachelier is currently offline Georges Bachelier
Messages: 25
Registered: May 2010
Junior Member
Hello Andrew !

Thanks a lot for your help.

I finally got my project working with compile time weaving. I had to add AspectJ capability to all my plug-ins in the RCP application, and then add the AspectJ plug-in project to the Aspect Path of each of them.

Cheers !

Georges
Previous Topic:folding problem (..)
Next Topic:AJDT is not working in eclipse
Goto Forum:
  


Current Time: Fri Sep 19 14:00:02 GMT 2014

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

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