Compile-time-weaving should be good enough. What I am working on is mostly a 
self-contained RCP.  You stated that, "I think you need to create the 
dependencies between your bundles in the right way and tell the AspectJ 
compiler to use the aspects from another project to weave them into some other 
projects."

Is there any documentation out there on this? Has anybody done it before? Let 
me know if so, I am clueless on how to do this and I cannot find any 
documentation on it :(
________________________________________
From: [email protected] [[email protected]] On 
Behalf Of Martin Lippert [[email protected]]
Sent: Saturday, July 03, 2010 2:59 AM
To: [email protected]
Subject: Re: [aspectj-users] Question about Compile Time Weaving, OSGI, Java    
Web Start, and code duplication

Hi Daniel,

I haven't tried this myself, but you should be able to use compile time
weaving for aspects within an OSGi world. I think you need to create the
dependencies between your bundles in the right way and tell the AspectJ
compiler to use the aspects from another project to weave them into some
other projects.

The difference to load time weaving is: using compile time weaving you
need to hard-weave your aspects into your OSGi bundles. This means your
aspects can only affect classes from other bundles that you are aware of
at compile time. This might not always be the case for OSGi since new
bundles from other parties are coming and going.

For example: if your aspect should weave into some existing Eclipse SDK
bundles that people have installed on their machines, compile time
weaving might be somewhat complicated (you would to recompile those
bundles and put them into a fragment for the SDK bundles). If your
aspects should also weave against new bundles that people might install
in the future, compile time weaving is also not really usable.

If you implement a self-contained rich client platform and you (or your
team) are the only people defining what gets installed in that OSGi
runtime, compile time weaving is an option, I think.

Just a few thoughts,
-Martin



On 02.07.10 15:17, Kashtan, Daniel wrote:
> Hey all,
>
> I am currently developing an OSGI project that makes use of AspectJ. I am 
> using Java Web Start too which means that I cannot use Load Time Weaving. 
> With Compile Time Weaving, it appears that I will need *.aj files for every 
> bundle, and that I have to duplicate code if I want the same aspect to affect 
> java classes in different bundles. Am I wrong about this? I am not sure if I 
> am misinterpreting what Equinox Aspects is saying about Compile Time Weaving, 
> or if I am not taking advantage of OSGI enough to be able to use aspects in 
> multiple bundles. Let me know if I made my problem clear and if I have any 
> way around duplicating aspect code.
>
> This e-mail and any files transmitted with it may be proprietary and are 
> intended solely for the use of the individual or entity to whom they are 
> addressed. If you have received this e-mail in error please notify the sender.
> Please note that any views or opinions presented in this e-mail are solely 
> those of the author and do not necessarily represent those of ITT 
> Corporation. The recipient should check this e-mail and any attachments for 
> the presence of viruses. ITT accepts no liability for any damage caused by 
> any virus transmitted by this e-mail.
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to