title: Spring-AOP: @AfterReturning advice confusion(s)
body: <pre><code>@Pointcut("execution(* package.method(..))")
  public void onComplete() {
  }
  </code></pre>
  
  <p>Given above, I tried to declare an <code>@AfterReturning</code> advice in following ways:</p>
  
  <pre><code>//Sample 1      
  @AfterReturning(value="onComplete()",
                  returning="returnValue")
  public void callOnCompletion(Object returnValue){               
      // aditional code here ..
  }
  
  //Sample 2
  @AfterReturning(pointcut="onComplete()",
                  returning="returnValue")
  public void callOnCompletion(Object returnValue){               
      // aditional code here ..
  }
  
  //Sample 1 with JoinPoint
  @AfterReturning(value="onComplete()",
                  returning="returnValue")
  public void callOnCompletion(JoinPoint jp, Object returnValue){               
      // aditional code here ..
  }
  
  //Sample 2 with JoinPoint
  @AfterReturning(pointcut="onComplete()",
                  returning="returnValue")
  public void callOnCompletion(JoinPoint jp, Object returnValue){               
      // aditional code here ..
  }
  </code></pre>
  
  <p>My doubts are as follows:</p>
  
  <ul>
  <li>What is the difference between <code>value</code> and <code>pointcut</code> attributes passed to <code>@AfterReturning</code> ?</li>
  <li>Which one of the two(<code>value</code> and <code>pointcut</code>), is default ? </li>
  <li>When to pass a <code>JoinPoint</code> parameter to the advice and when not to pass? Is there any rule  or situation ? I have seen examples which are defined with out <code>JoinPoint</code>. But when I tried to pass <code>JoinPoint</code> to <code>callOnCompletion(..)</code> method, I get <code>formal unbound in pointcut ...</code> error while initialization. </li>
  <li>Is parameter <code>returnValue</code> needed for <code>void</code> return type ?</li>
  <li>Is parameter <code>returnValue</code> mandatory for those methods which actually return a value?  </li>
  </ul>