[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [aspectj-users] LTW and instrumentation
- From: "Ron Bodkin" <rbodkin@xxxxxxxxxxxxxx>
- Date: Mon, 31 Oct 2005 11:29:15 -0800
- Delivered-to: firstname.lastname@example.org
- Organization: New Aspects of Software
- Thread-index: AcXc4eUjVcbfBTp6QaCqnnopbaXTEgBDeaLgABYwIyAAAhHQUA==
Yes, using an ITD in a general case like this would require using
reflection. Now Java reflection has become pretty efficient (e.g., Hibernate
and other popular O/R mapping tools use it extensively). Certainly in the
article's case, to implement, toString, it would be natural to use an ITD.
If you need bytecode generation for efficiency, then an ITD wouldn't help.
To the question of chaining agents, I have been thinking about this issue
and I think there's a need for a ChainedAgent jvmti agent, that would let
you register multiple JVMTI javaagent's to run in a specified order. I bet
if you wrote a good one of those, you'd have a lot of interest in using what
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Pascal Felber
Sent: Monday, October 31, 2005 11:13 AM
Subject: RE: [aspectj-users] LTW and instrumentation
But then, it would require using reflection, right? In fact, I need to do
something slightly different from the article I cited: for each field of
primitive type in a class, I need to declare a "backup" field of the same
type and create checkpointing functions to save/restore the object's state.
These functions are called quite often and must be very efficient (using
reflection would be too slow for that purpose). ASM seems to be appropriate
for transparently generating them, assuming it can be combined with LTW, but
I'd love to hear other suggestions. Thanks.
> It looks to me like the code from the article you cited could
> be written more cleanly with an inter-type declaration,
> instead of mucking around with ASM.
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Pascal Felber
> Sent: Saturday, October 29, 2005 4:39 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] LTW and instrumentation
> I have an aspectj application that uses LTW (aspectjweaver
> agent) to weave aspects at load time. In addition, I have to
> instrument some of my classes along the same lines as
> described at
> (functionality that cannot be added using AOP).
> Instrumentation is performed using ASM and I am currently
> using a java transformation agent. The problem is, I haven't
> been able to used both agents (aspectjweaver and my own
> agent) at the same time. I would like my agent to get a
> chance to instrument the classes before they are (or right
> after they have been) processed by the aspectj load-time
> weaver. Is that possible? Does aspectj allow custom
> instrumentation of classes during the weaving process?
> aspectj-users mailing list
> aspectj-users mailing list
aspectj-users mailing list