Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How may I match join points in these patterns?

Dear Folks,
 
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!
 
Sunny


 
On 3/30/06, Wes Isberg <wes@xxxxxxxxxxxxxx> wrote:
 
1: call(ClassA.new())
 
2: call(B.new())
 
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.
 
Thanks,
Wes
 
------------Original Message------------
From: Sunny <sunfire001@xxxxxxxxx>
Date: Wed, Mar-29-2006 6:41 PM
Subject: [aspectj-users] How may I match join points in these patterns?
Dear All,
 
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!
 
Sunny
 
 
_______________________________________________

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top