Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Object Graph using aspectj

 Hi,
  I am new to aspectj and am trying to use it to create and synchronize
object graph during program execution. Which means I need pointcuts for
situation when any object adds/removes a reference to another object, and
pointcut when a new object is created. This is how far I have gotten.


For situation when any object adds/removes a reference to another object

 pointcut assignments(Object assigned, Object to):
         
        set(Object *.*) && args(assigned && target(to) &&
          !within(edu.testing.lib.*) ;

seems to work accepts assignments with in methods. Any suggestions on how to
do that?

For monitoring when a new object is created I have this. 
 
 pointcut constructor() : (call(*.new(..)) || call(*.new())) &&
    !within(edu.testing.lib.*)    ;

  after() returning(Object o) : constructor()     {
       
        System.out.println(o.toString());
        System.out.println(thisJoinPoint.getThis().toString()); 
    }

This seems to trigger correctly in all cases but I cannot get the following
information, 
 1 What Object is getting created.
 2 And which object is creating this object.
I need to create the object graph. Again any suggestions?
Thank you
-- 
View this message in context: http://www.nabble.com/Object-Graph-using-aspectj-tp20977582p20977582.html
Sent from the AspectJ - users mailing list archive at Nabble.com.



Back to the top