Spring AOP Method Interceptor vs Method Advice -


i new aop , trying understand difference between method interceptor , methodadvice(i.e. methodbeforeadvice or methodafteradvice). me looks both doing same thing i.e. called on method invocation. when should use methodinterceptor vs methodadvice.

take @ definition of org.aopalliance.interceptinterceptor interface (implemented methodinterceptor):

public interface interceptor extends advice { } 

it's easy see methodinterceptor advice. difference between advice being defined in @aspect class , such interceptor interceptor implementations can added , removed spring aop proxies @ runtime (casting them 'advised'), whereas advice you're talking more static construct. still essential spring aop since presence tells spring beans wrap in proxy object during application context startup.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -