title: Decorate or Intercept Spring @Autowired Bean
body: <p>I am upgrading old Java EE application to Spring based solution. In the old applications there were custom annotations to create proxy inject proxy bean and intercept the method invocation [Interceptor classes implements <code>MethodInterceptor</code>) or (implements <code>InvocationHandler</code>), which used to perform some before and after execution stuff.</p>
  <p>We have replaced those custom annotations with Spring marker interfaces like @Service, @Repository etc. and we are able to use @Autowire the bean instances. Now my question is how to intercept these autowired beans to perform per and post execution activities. One solution I can think is to use Spring AOP and use @Around pointcut. Just want to know is there any other and better alternative which can be used like</p>
  <ol>
  <li>extending <code>org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor</code></li>
  <li>Using <code>BeanFactoryPostProcessor</code> or <code>BeanPostProcessor</code>.</li>
  <li>Using <code>InstantiationAwareBeanPostProcessor</code></li>
  </ol>