Re: [abc-users] Weaving Adaptor in abc?

From: Eric Bodden <eric.bodden_at_mail.mcgill.ca>
Date: Tue, 7 Oct 2008 13:09:22 -0400

Hi Alex.

I am not one of the original implementers/designers of abc but I will
try to answer your questions to the best of my knowledge.

> Is there a weaving adaptor similar to AspectJ's WeavingAdaptor enabling
> easy third party integration of abc?

Not yet but looking at the interface I believe that it should be
possible to provide such an interface (although that's probably not a
project that can be completed in a day or two).

> All we need is something like:
>
> byte[] weaveClass(java.lang.String name, byte[] bytes);
>
> and probably we could specify the location of the aspect sources (and
> classpath) in the constructor of the adaptor.. AspectJ's WeavingAdaptor
> uses by default aspectpath.lst and classpath.lst The first one contains the
> compiled aspect, and the second the list of jars needed for the weaving.

What is the "bytes" argument good for here? Are the contents of this
byte array not the same as the ones that one would obtain by loading
the class given its name using the classpath that was provided in the
constructor?

> Concerning the limitation of abc to make separate compilation, we could use
> the following workaround:
>
> - compile the aspect with a dummy set of classes, so as to create the
> compiled aspect (needed by our framework to be loaded).
> - put the reference to the source of the aspect in the aspectpath.lst
> (instead of the compiled one as with AspectJ..). This should emulate the
> -argfile aspectpath.lst
>
> What I'm not sure is if the compiled aspect will be the same in both cases
> (I guess so..)

I think this may actually work. I am reasonably sure that both aspects
should be the same. There may be issues with inconsistent
(pseudo-random) method names being generated for the same aspect on
multiple executions but if this is the case then it could certainly be
fixed.

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
Received on Tue Oct 07 2008 - 18:09:28 BST

This archive was generated by hypermail 2.2.0 : Tue Oct 07 2008 - 18:40:11 BST