[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ews.eclipse.technology.aspectj] RCP & AspectJ

Hi, all: I've been busy trying to make them (aj & rcp) work together and I'd
like to share my experiences, hoping they could help some other people and
have some of my (confused) ideas clarified.

I've a bunch of aspects scattered along several plugins in my RCP
application: some of them are shared among different plugins so I'd like to
put them in an "aspects collection plug-in". 

So I've put my test abstract aspect (a dummy logger) in my aspects plugin,
added this as a plug-in dependency to my own to-be-weaven plug-in,
implemented the concrete aspect using the "participant pattern" explained
in [4] and crossed the fingers. 

Now:
1) the IDE shows the captured join points (good) (see [3])
2) when I execute my application the awaited aspect's output is simply
absent so I guess that my aspects has been forgotten :S (bad)

Then I read on the mailing list about AJEER ([2], Martin Lippert has updated
it to the latest stable AspectJ 5.0 release) and configured my application
as explained in [1]. I've added a second aspect to my aspects plug-in which
implements the worker object pattern as explained in [4] (just using some
custom annotations to mark the methods to be run in a different thread).
Now the console output of my app becomes:

MY PERSONAL ADAPTOR IS CREATED AND WILL START THE FRAMEWORK
Start Weaving Service
aspect promoted to the system:
it.uniba.di.cdg.xcore.aspects.it.uniba.di.cdg.xcore.aspects.AnnotatedAsynchronousExecution,
1.0.0
aspect promoted to the system:
it.uniba.di.cdg.xcore.weaveme.it.uniba.di.cdg.xcore.weaveme.View$OwnLog,
1.0.0
WeavemePlugin.start()
additional classes put in cache:
it.uniba.di.cdg.xcore.weaveme.View$AjcClosure1
[Before] execution(View.createPartControl(..))
[Before] execution(View.setFocus())
[START] AsynchronousExecution.around()
[END] AsynchronousExecution.around()
<snip: some counting follows ...>

Wow, this is nice ... but it is *sloooow*: it takes 20+ seconds on my
p3@xxxxxx / 1G linux box to show the application window (most time seems to
be spent after the "additional classes put in cache:" message): and there
are just two plugins (+ the 2 AJEER plugins and the RCP runtime).

If you are interested you can download my test application in [5]. It is
composed by:
- an aspects plugin which collects all of my test aspects
- a "weaveme" plugin containing the view and product 
- a "weaveme" feature projects that I used to compose my product since
configuring it with plugins didn't make the eclipse runtime happy (no
product id found :S).
(Obviously you must have the AJEE plugins in your target platform
directory!)

So what are your current experiences with the subject? 

Regards
Mario

Ps: Hmmm ... perhaps this is heavy matters for holidays season :) Merry xmas
and happy new year to all the people out there, anyway.

[1] http://ajeer.sourceforge.net/?cat=3
[2] http://sourceforge.net/projects/ajeer
[3] http://cdg.di.uniba.it/~mscalas/join_points.png
[4] AspectJ in Action (see also
    http://www-128.ibm.com/developerworks/java/library/j-aopwork3/ )
[5] http://cdg.di.uniba.it/~mscalas/ajeer_experiment.tar.gz