Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Dynamic attachment of the aspect javaagent

> I think when a class is LTW weaved with Aspects, it is impossible to un-weave it dynamically. am
> I right?

Kind of two options:

- If the JVM was running in debug mode, then you could hotswap the
changes in.  If it is simple advice calls (and no structural changes,
the kind which use of ITDs would cause) then you could hotswap in code
that didn't have those calls.

- manage with classloader granularity, throw away the classloader with
your woven code in it and create a new one for your unwoven variant.

cheers,
Andy


On 8 November 2011 09:24, Pasturel <jean-louis.pasturel@xxxxxxxxx> wrote:
> I have made an enhancement about this, a year ago i think ( new feature for
> AspectJ 1.6.x), by using the Attach API that came with JDK 1.6 ( tools.jar).
> With this API it is possible to attach dynamically an agent to a JVM, but i
> failed to attach the LTW agent ( Pb of classloaders and classes yet loaded
> => Andy could explain better than me)
>
> But as Andy said, the use case may be analyzed deeper. I think when a class
> is LTW weaved with Aspects, it is impossible to un-weave it dynamically. am
> I right? With boolean flags, we certainly can deactivate the advices.
>
> Le 08/11/2011 18:01, Andy Clement a écrit :
>>
>> Hi,
>>
>> I don't recall the exact discussion about it from the mailing list.
>>
>> Nothing has been actively done in this area - not sure we even have an
>> open bugzilla for an enhancement.
>>
>> Completely dynamic attachment, I guess something might be possible
>> there if communicating with the JVMTI interface. Simpler might be to
>> run with javaagent but have it turned off (checking some kind of flag)
>> until something occurs that switches it on (sets that flag).
>>
>> Do you have a specific use case that requires dynamic attachment?
>>
>> cheers,
>> Andy
>>
>> On 8 November 2011 08:27,<Richard_Whitehurst@xxxxxxxxxx>  wrote:
>>>
>>> A while back there were some questions about dynamically attaching the
>>> aspectj javaagent; has there been any progress on this, or was there not
>>> enough interest to pursue it?
>>>
>>>
>>>
>>> My apologies if this is documented somewhere and I missed it.
>>>
>>>
>>>
>>> Thanks
>>>
>>> Dick Whitehurst
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top