title: Spring AOP - pointcut for every method with an annotation
body: <p>I am trying to define a pointcut, that would catch every method that is annotated with (i.e.) <code>@CatchThis</code>. This is my own annotation. </p>
  
  <p>Moreover, I'd like to have access to the first argument of the method, which will be of <code>Long</code> type. There may be other arguments too, but I don't care about them.</p>
  
  <hr>
  
  <p>EDIT</p>
  
  <p>This is what I have right now. What I don't know is how to pass the first parameter of the method annotated with <code>@CatchThis</code>.</p>
  
  <pre><code>@Aspect 
  public class MyAspect {
      @Pointcut(value = "execution(public * *(..))")
      public void anyPublicMethod() {
      }
  
      @Around("anyPublicMethod() &amp;&amp; @annotation(catchThis)")
      public Object logAction(ProceedingJoinPoint pjp, CatchThis catchThis) throws Throwable {
          return pjp.proceed();
      }
  }
  </code></pre>