Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] weaving information via messages

Hi Mik,


Before I start looking at it just a short question: I use only the weaving
part,
as you know, for my load-time weaving for the Eclipse system. Therefore I
weave
class per class. And I need the structure information for after each
single
class that is woven. Do you think it would be possible to use the
structure
model for this kind of single-class-weaving?

If so, what do I have to do to set up and reset the structure model for
the
weaver/world? (Because I do not use the real compiler or builder parts)


Since you're only after simple dependency information you should be able to
ignore the structure model and just mimic the way that it gets that
information from the weaver.  The easiest way to do this is probably by
modifying the org.aspectj.weaver.Shadow.implementMungers() method.  Note how
it calls AsmAdaptor.noteMunger(..) with a shadow and a munger.  You can
refer to the way that AsmAdaptor uses this info to generate the crosscutting
dependencies.  A better way to do that would be to subclass AsmAdaptor.  But
for that you'll need to extract a super class that's decoupled from
StructureModel and get rid of AsmAdaptor's static methods.

That was my first way to implement it, using the message handler as Jim suggested in an earlier posting. I implemented a patch for that:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=36747

But there is one thing that confuses me a bit: The AsmAdaptor is used only inside the class Shadow. I got the impression that this is not enough the get the information for type mungers. For example: the aspect provides nothing else but:

...
declare parents: prg.eclipse.jdt.core.JavaCore implements MySpecialInterface
...
(where MySpecialInterface is empty)

The Shadow.implementMungers method is never called but the class JavaCore is definitely changed by the weavig process. I added a notification also in the class BcelTypeMunger to get this weaving information but there is no call to AsmAdaptor. How does AJDT got such information?

Best regards,
Martin

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Back to the top