Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] pertarget instantiation && within

I would like to create a new aspect instance for each new SomeClass object. The problem is that the responsibility of the aspect constructor is to create a new SomeClass object. Thus, an infinite recursion occures. So, I use the !within(XYZ) designator, but it doesn't work.

I am not sure if I understand the question. What is the use case you
are trying to implement?

-Ramnivas

2009/4/18 Adam Przybylek <adam@xxxxxxxxxxx>:
aspect XYZ pertarget(target(SomeClass) && !within(XYZ)) {
 protected SomeClass sm;

 public XYZ() {
   sm = new SomeClass();
 }
}

I would like not to instantiate the XYZ aspect when the object referred by
sm is created. What do I do wrong?



Back to the top