title: Creating our own aspects using custom annotations
body: <p>I am new to Annotations and new to StackOverflow and this is my first question. I am trying to write custom annotations which will help me trace and log method executions.</p>
  
  <p>For example:</p>
  
  <pre><code>class A
  {
  
  @Logthis
  
  void methodA();
  
  }
  </code></pre>
  
  <p>Here whenever the method <code>methodA()</code> is executed, I want to log to a file telling "we are entering the methodA in class A" and when methodA is over "we are exiting methodA in class A" something like this. We vil have a number of classes and methods. </p>
  
  <p>I know that this can be done using AspectJ. I have done it by defining pointcuts and joinpoints. But I want to do it using custom annotations. </p>
  
  <p>It will be very helpful if anyone can guide me as to how to go about this.</p>
  
  <p>Thanks in advance.</p>