Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Weaver used in load-time

By the way, I wrote and contributed a command-line weaver like this that
have been using on a project to distribute a rich client as a set of
components. We wanted to avoid distributing changes to many components
whenever we change some of the aspects, but also wanted to avoid
distributing a 4.5 M+ tools jar. The result is 12k plus the 1.7M
aspectjweaver.jar.

However, making a command line weaver only cleanly would require refactoring
to move some code out of tools jar dependencies (I did a bit of copy/paste
instead), so it was decided to target this feature for 1.5.1 (see bugzilla
#113191).



-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Wes Isberg
Sent: Monday, February 13, 2006 10:10 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Weaver used in load-time

> it safe to say that this is the same weaver used in static (i.e. 
> compile-time) weaving? 

As Ron said, basically yes.

> Does it apply all the same analises and 
> optimizations?

Some things are the responsibility of the compiler, so no weaver would
do everything ajc did.  Do you have a more specific issue/question?

We do say that you should get the same results whether you are using
build-time or load-time weaving (indeed, having two separate weavers
would introduce a number of issues for validating that assertion),
and using @AspectJ annotation style and code style.  However, there
are limitations with annotation style and some differences with LTW.
We try to work on the differences that make a difference ASAP, and
optimize for build-v-LTW with flags - e.g., Adrian is looking at 
maintaining the threadlocal stack only when doing LTW weaving.  Also,
if you're thinking of embedding the weaver in another application,
there has long been talk of packaging the weaver as a stand-alone
command-line executable, but we haven't had a compelling use-case yet.
To try that, just build the weaver module with the "all" (i.e., 
accumulate) flag - see the build docs.

Wes

> ------------Original Message------------
> From: Eduardo Santos Cordeiro <cordeiro@xxxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Mon, Feb-13-2006 8:23 AM
> Subject: [aspectj-users] Weaver used in load-time
>
> Hello there,
> 
> I've been sniffing through the source code of ajc, especially inside 
> classes WeavingURLClassLoader and WeavingAdaptor, and it seems that 
> after loading the definitions, BcelWeaver is used to weave aspects. Is 
> it safe to say that this is the same weaver used in static (i.e. 
> compile-time) weaving? Does it apply all the same analises and 
> optimizations?
> 
> Thank you,
> 
> Eduardo Cordeiro
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 

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




Back to the top