Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In Spring AOP, I can add an aspect at the following locations

  • before a method executes (using MethodBeforeAdvice)
  • after a method executes (using AfterReturningAdvice)
  • around a method (both before and after a method executes) (using MethodInterceptor)

If I have all three types of advice, is the order of execution always as follows?

  • Around (before part)
  • Before
  • Method itself
  • After
  • Around (after part)
share|improve this question
    
What? 15 char.. –  David Cowden Sep 13 '12 at 8:35
    
You'd do better searching for an answer to this on Stack Overflow; that's the place for programming questions with a simple, correct answer. –  Donal Fellows Sep 13 '12 at 8:51
    
@Donal Fellows My bad. I thought this would be more theoretical than is allowed in Stack Overflow –  Chetter Hummin Sep 13 '12 at 9:41
add comment

1 Answer 1

up vote 1 down vote accepted

Please go through the link. To understand the ordering of Spring AOP advices:

ordering of Spring AOP advices

share|improve this answer
1  
Please expand your answer by adding some excerpt from the linked article. –  bytebuster Nov 18 '12 at 10:04
    
Thanks for the linked answer –  Chetter Hummin Nov 18 '12 at 12:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.