title: Why does self-invocation not work for Spring proxies (e.g. with AOP)?
body: <p>Please explain, why self invocation on proxy performed on target but not proxy? If that made on purpose, then why? If proxies created by subclassing, it's possible to have some code executed before each method call, even on self invocation. I tried, and I have proxy on self invocation</p>
  
  <pre class="lang-java prettyprint-override"><code>public class DummyPrinter {
      public void print1() {
          System.out.println("print1");
      }
  
      public void print2() {
          System.out.println("print2");
      }
  
      public void printBoth() {
          print1();
          print2();
      }
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>public class PrinterProxy extends DummyPrinter {
      @Override
      public void print1() {
          System.out.println("Before print1");
          super.print1();
      }
  
      @Override
      public void print2() {
          System.out.println("Before print2");
          super.print2();
      }
  
      @Override
      public void printBoth() {
          System.out.println("Before print both");
          super.printBoth();
      }
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>public class Main {
      public static void main(String[] args) {
          DummyPrinter p = new PrinterProxy();
          p.printBoth();
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre class="lang-none prettyprint-override"><code>Before print both
  Before print1
  print1
  Before print2
  print2
  </code></pre>
  
  <p>Here each method called on proxy. Why in documentation mentioned that AspectJ should be used in case of self invocation?</p>