title: Spring AspectJ Custom Annotation for Logging
body: <p>I have defined a custom annotation as below.</p>
  
  <pre><code>package com.xyz;
  @Target(ElementType.METHOD)
  @Retention(RetentionPolicy.RUNTIME)
  @Documented
  public @interface Loggable {
      String message() default "Log Message";
  }
  </code></pre>
  
  <p>My aspect class contains the below method:</p>
  
  <pre><code>@Around(value = "@annotation(com.xyz.Loggable)")
  public void logAround(ProceedingJoinPoint joinPoint) throws Throwable {
      // come code here
  }
  </code></pre>
  
  <p>My service interface is as below.</p>
  
  <pre><code>public interface Service {
     @Loggable
     public void method1();
  }
  </code></pre>
  
  <p>My implementation is as below.</p>
  
  <pre><code>public class ServiceImpl implements Service {
       public void method1() {
           // some code here
       }
  }
  </code></pre>
  
  <p>With this setup, My advice is not getting triggered. (however it gets triggered if i move the @Loggable annotation to method1() in ServiceImpl class).</p>
  
  <p>I would like to keep the annotation defined at interface level instead of method implementations. Is there a way to get this work ?</p>