|
From: Eugene K. <eu...@md...> - 2005-08-29 12:10:49
|
Alexandru Popescu wrote: >> After returning advice is indeed processed in the opposite order. >> Since the method invocation moves back up the advisor chain the last >> advisor is processed first, then the second to last and so on until >> all advisors have been processed. >> >> If you would chain an number of around advices (method interceptors) >> they would also be processed in the inverse order once the target >> method exits although they have been called in the expected order when >> the method invocation starts. > > This looks to me pretty unintuitive, because we are talking about > after advices. The rules you are exposing are correct, but they apply > to around advice. I imagine that this is caused by the fact that > Spring doesn't have real before and after advices, but rather it is > emulating them using always around (this is true for all proxy based > aop solutions). First of all there are explicit Before and After advices semantically possible with Spring. It has very little todo that actual implementation is using proxy, which is always gives an around advice. Note, that nothing actually stops user to implement Before and After interfaces in the same class and put it into the list of advices (even mixed with around advices). So, current behavior seems very logical if you'll take this fact into the account. regards, Eugene |