[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] How may I match join points in these patterns?
- From: Sunny <sunfire001@xxxxxxxxx>
- Date: Thu, 30 Mar 2006 14:11:20 -0500
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=qsrI40gPX0Tq5LlhqeFQZOx2g37cNIU3sGGIy02CTicvgwJy/jXi31alP0FcVdrYRJ3fw2WX44qj3QlZ2UX9oRTzT2/6TnuKFpbTiVYvprdRM/QzQIzyEtybNKy48uaWuCcbsLQE/NSCB9TRbAe8CkCaNj/j4Fh4L1AsWJilMOc=
Thank you for the possible solutions!
Essentially, I would like to keep track of all objects that have references to a certain object in the current system state. This information could be used to infer the relationships between runtime objects, e.g,, whether the relationships are temporary or more "permanent". The two patterns I described reflect this idea. That is, an new object is created, but the creating object does not hold any reference to it, either through a local variable or a field. And the only purpose for creating this object is to pass it to others (
e.g., in factory pattern). Therefore they have a temporary relationship.
To keep track of all the references to an object, AspectJ supports field set pointcut. Yet, I think it would be nice if we also have the set pointcut for local variables since an object could refer to other objects through its local variable.
Thank you for your comments!
On 3/30/06, Wes Isberg <wes@xxxxxxxxxxxxxx> wrote:
Except for within(..) and withincode(..) there is no constraint on where or when the join points are matched.
Sunny, like others I'm interested in what you're trying to do. Many of your questions have been corner cases
in the AspectJ language like those that folks at Sun complain about. Can you say who you are or what you're
working on? It might help when people try to answer your questions.
Date: Wed, Mar-29-2006 6:41 PM
Subject: [aspectj-users] How may I match join points in these patterns?
How may I match join points in the following two patterns?
1. when an object is created and immediately returned to the caller:
public ClassA m1()
return ( new ClassA() );
2. when an object is created and immediately passed to another context through a method call:
objectA.m( new B(), arg1, arg2, ... );
Thanks very much!
aspectj-users mailing list