Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Generated AjcClosure classes

Hi Silviu,

> I am using Aj to perform runtime weaving. Afterwards, I'm saving the weaved
> class into a cache so as to avoid the instrumentation on subsequent runs.

You know, I'm on the verge of creating such a thing in AspectJ
itself... I would be interested to here about your approach and how
you know when to invalidate the cache, and what are you using as the
cache key (some combination of the class itself hashed or something,
plus the combination of aspects defined at the time, hashed or
something?)

If AspectJ did this itself then the only user configuration would be a
place to keep these woven classes so that they can be retrieved later.
 Do you have any specific requirements for the cache in your scenario?
(or does anyone else reading this have requirements on a cache like
this?)

> Now, my problem is that I use around advices that create additional
> Class$AjcClosure.
> Is there any way I can get handle of those classes? I must mention I am
> using a java agent that would normally be called whenever a new class is
> loaded, but it appears that the Closure classes somehow escape this.

There currently isn't a way for you to get at them I don't think - but
there have been other requests to access them, or at least be made
aware of them.  This wasn't for a caching purpose but merely to avoid
clashes in the case where an attempt is made to define the same class
twice (https://bugs.eclipse.org/bugs/show_bug.cgi?id=287426).

Raise an enhancement request and I'll see what I can do.

Andy


Back to the top