0

As we know that in AOP, we can introduce aspects using @Before @After and @AfterReturning. But if i want to insert any Logger statement in between of method, i.e. after execution and before the end of the method. How can we do this using Spring AOP?

Ali Dehghani
  • 46,221
  • 15
  • 164
  • 151
Sushant
  • 145
  • 1
  • 2
  • 12
  • 1
    What is the difference between "after execution and before the end of the method" and @After? – Heri Mar 12 '16 at 18:56
  • 1
    Your description is unclear. Please update the question with some sample code and explain what should happen when. And please also answer the question asked by @Heri. – kriegaex Mar 12 '16 at 23:15

1 Answers1

2

You cannot put AOP in between your method execution. You can do before, after, around, etc.

If you want in between I would suggest refactor your method into multiple methods and use AOP to the relevant method.

Bhushan Bhangale
  • 10,921
  • 5
  • 43
  • 71