weaving existing OSGi jars and exclusion of aspect classes

View: New views
4 Messages — Rating Filter:   Alert me  

weaving existing OSGi jars and exclusion of aspect classes

by Captain Haddock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ultimately trying to do the following:

- all aspect classes will be included in a single OSGi bundle
- existing OSGi bundles will be woven with aspects

Instead of including the aspect classes in the resulting bundle, I would
like to update the OSGi bundle's dependencies to include the OSGi bundle
containing the aspect classes.

So first thing is whether the aspectj-maven-plugin has ability to not
include the aspect classes? (I did not see a parameter to toggle this:
http://mojo.codehaus.org/aspectj-maven-plugin/compile-mojo.html).

Second thing is the updating of the bundle dependencies .. anything
there that can help me? (or I will have to do via a bunch of manual steps).

If these questions are better asked on another list then please advise.

thanks, Haddock

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: weaving existing OSGi jars and exclusion of aspect classes

by Simone Gianni-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Haddock,
what you are talking about are "Aspect Libraries", that is a jar
containing aspect that is then applied to other classes. This can be
done by ajc and by the maven plugin. Let's call the jar containing the
aspects "library" and the jar containing classes to be woven "target".

Obviously target will have the library as a dependency. Then, the
library must be on the "aspect path" of ajc, to do this you can
configure the mojo as explained here
http://mojo.codehaus.org/aspectj-maven-plugin/libraryJars.html

Another option is to use Equinox Aspects, which will apply your aspect
library bundle directly to the target bundle at runtime, using LTW
instead of compiling it during build time, making it very dynamic as it
should be in OSGi.

Hope this helps,
Simone

Captain Haddock wrote:

> Ultimately trying to do the following:
>
> - all aspect classes will be included in a single OSGi bundle
> - existing OSGi bundles will be woven with aspects
>
> Instead of including the aspect classes in the resulting bundle, I
> would like to update the OSGi bundle's dependencies to include the
> OSGi bundle containing the aspect classes.
>
> So first thing is whether the aspectj-maven-plugin has ability to not
> include the aspect classes? (I did not see a parameter to toggle this:
> http://mojo.codehaus.org/aspectj-maven-plugin/compile-mojo.html).
>
> Second thing is the updating of the bundle dependencies .. anything
> there that can help me? (or I will have to do via a bunch of manual
> steps).
>
> If these questions are better asked on another list then please advise.
>
> thanks, Haddock
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@...
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


--
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
http://www.simonegianni.it/

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: weaving existing OSGi jars and exclusion of aspect classes

by Captain Haddock-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Simone Gianni wrote:

> Hi Haddock,
> what you are talking about are "Aspect Libraries", that is a jar
> containing aspect that is then applied to other classes. This can be
> done by ajc and by the maven plugin. Let's call the jar containing the
> aspects "library" and the jar containing classes to be woven "target".
>
> Obviously target will have the library as a dependency. Then, the
> library must be on the "aspect path" of ajc, to do this you can
> configure the mojo as explained here
> http://mojo.codehaus.org/aspectj-maven-plugin/libraryJars.html
but the result is a jar that includes both the "library" and the
"target" .. I did not see options to exclude the "library"

maybe I missed some option with the aspect-maven-plugin?

or maybe I'm making this difficult .. just don't jar everything
automatically .. instead do the weave, remove the library classes then
do a separate packaging
>
> Another option is to use Equinox Aspects, which will apply your aspect
> library bundle directly to the target bundle at runtime, using LTW
> instead of compiling it during build time, making it very dynamic as it
> should be in OSGi.
great pointer .. thx .. looks to be just what I need .. hopefully there
is something stable there

>
> Hope this helps,
> Simone
>
> Captain Haddock wrote:
>> Ultimately trying to do the following:
>>
>> - all aspect classes will be included in a single OSGi bundle
>> - existing OSGi bundles will be woven with aspects
>>
>> Instead of including the aspect classes in the resulting bundle, I
>> would like to update the OSGi bundle's dependencies to include the
>> OSGi bundle containing the aspect classes.
>>
>> So first thing is whether the aspectj-maven-plugin has ability to not
>> include the aspect classes? (I did not see a parameter to toggle this:
>> http://mojo.codehaus.org/aspectj-maven-plugin/compile-mojo.html).
>>
>> Second thing is the updating of the bundle dependencies .. anything
>> there that can help me? (or I will have to do via a bunch of manual
>> steps).
>>
>> If these questions are better asked on another list then please advise.
>>
>> thanks, Haddock
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@...
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: Re: weaving existing OSGi jars and exclusion of aspect classes

by Ichthyostega :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Simone Gianni wrote:
>> what you are talking about are "Aspect Libraries", that is a jar containing
>>  aspect that is then applied to other classes.
...
>> Obviously target will have the library as a dependency.
...

Captain Haddock schrieb:
> but the result is a jar that includes both the "library" and the "target" ..
> I did not see options to exclude the "library"

It is very common that the lib includes some bits which need to be
present at runtime. If the library indeed consisted only of plain
aspects which maybe change the hierarchy, soften exceptions or
add annotations, then you might be able to run the woven code
without the library on your runtime classpath. But this situation
is extremely rare and, moreover, isn't easy to detect and distinguish
without understanding the internals of how the woven code works.

But maybe I haven't fully grasped your question...

Hermann




_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users