Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Super's accessibility from within the advice

Hello,

I think the following action is not possible in
AspectJ:

public class ClassSuperA {

   public void a1() {
       a3();
       System.out.println("ClassSuperA.a1()");
   }
     public void a3() {
       System.out.println("ClassSuperA.a3()");
   }
      }

-----------------------------------------------------------

public class ClassA extends ClassSuperA{

   public void a1() {
       System.out.println("ClassA.a1()");
   }
     public void a2() {
       super.a1();
       a1();
       System.out.println("ClassA.a2()");
   }
     public void a3() {
       System.out.println("ClassA.a3()");
   }

     public static void main(String[] args) {
       ClassA a = new ClassA();
       a.a2();
   }
}

----------------------------------------------------------


Instead of calling super.a1(), I would like to have an
advice for the execution of ClassA.a2() that calls
ClassSuperA.a3(); That is, to advise ClassA.a2() with
the functionality of ClassSuperA.a1().

Moreover, I think it is not possible to have access to
the super's functionality of the advised object from
within the advice.


Thank you in advance for your opinions,
Marius 




		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


Back to the top