title: Spring AspectJ get method annotation from ProceedingJoinPoint
body: <p>I have an aspect that handles all methods that have a custom annotation.</p>
  
  <p>The annotation has an enum parameter and I have to get the value in the aspect:</p>
  
  <pre><code>@Target(ElementType.METHOD)
  @Retention(RetentionPolicy.RUNTIME)
  public @interface Monitored {
      MonitorSystem monitorSystem();
  }
  </code></pre>
  
  <p>My case is very similar to that <a href="https://stackoverflow.com/questions/21275819/how-to-get-a-methods-annotation-value-from-a-proceedingjoinpoint">question</a> and the accepted answer works for Spring beans that do not implement an interface.</p>
  
  <p>The aspect:</p>
  
  <pre><code>@Aspect
  @Component
  public class MonitorAspect {
  
      @Around("@annotation(com.company.project.monitor.aspect.Monitored)")
      public Object monitor(ProceedingJoinPoint pjp) throws Throwable {
          MethodSignature signature = (MethodSignature) pjp.getSignature();
          MonitorSystem monitorSystem = signature.getMethod().getAnnotation(Monitored.class).monitorSystem();
          ...
      }
  }
  </code></pre>
  
  <p>But if the Spring bean that is annotated with <code>@Monitored</code> (only the implementation class is annotated) implements an interface - <code>pjp.getSignature()</code> returns the signature of the interface and it does not have an annotation.</p>
  
  <p>This is OK:</p>
  
  <pre><code>@Component
  public class SomeBean {
     @Monitored(monitorSystem=MonitorSystem.ABC) 
     public String someMethod(String name){}
  }
  </code></pre>
  
  <p>This does not work - pjp.getSignature() gets the signature of the interface.</p>
  
  <pre><code>@Component
  public class SomeBeanImpl implements SomeBeanInterface {
     @Monitored(monitorSystem=MonitorSystem.ABC) 
     public String someMethod(String name){}
  }
  </code></pre>
  
  <p>Is there a way to get the signature of the implementation method from ProceedingJoinPoint?</p>