title: AOP Using Around to avoid executing a method
body: <p>I am using Spring AOP in my code to intercept the execution of a certain method. A simplified example of what I'm trying to do is below:</p>
  
  <pre><code>public void someMethod() {
      //does something
  }
  
  @Around("execution( someMethod())")
  public void anotherMethod(final ProceedingJoinPoint joinPoint) {
      //i want to add this to a queue to get executed later on
      addToWaitList(new Callable() {
          @Override
          public call() throws Exception {
              joinPoint.proceed();
          }
      });
      return;
  }
  </code></pre>
  
  <p>Essentially, I want to hold off the execution of <code>someMethod()</code> until it is at the head of the list. However, the main thread blocks, even though I return at the end of <code>anotherMethod()</code>, so I am unable to add a <code>new Callable</code> to the list until the first one is done executing. </p>
  
  <p>The documentation says you can shortcut the advised method execution by returning its own return value or throwing an exception. I don't want to throw an exception and am not really sure what "returning its own return value" means in this case. I want to be able to add the Callables to the list with the main thread and then have some other threadpool executing them.   </p>