AOP basic
Join Point – A point of execution of a program, such as a method call or exception thrown Pointcut – A expression that selects on one or more join points Advice – Code to be executed at each selected join
Join Point – A point of execution of a program, such as a method call or exception thrown Pointcut – A expression that selects on one or more join points Advice – Code to be executed at each selected join
Example 1: ProxyFactory + Advice The first example will show you how to use ProxyFactory with advice and target object. 1) Create a target object need to be advice. 2) Create an advice class and add it into ProxyFactory. 3) Create a new proxy object via ProxyFactory getProxy() method. 4)
Suppose I have a POJO called Address, I’d like to load external resource data and replace the address line1 and line2 value.
Bean post-processors, a special kind of spring bean that able to received bean lifecycle callback at various stages (initialisation/destruction), and perform additional task on each bean before it’s initialisation. Example, RequiredAnnotationBeanPostProcessor is a spring bean post processor, it responsibility is to check