1. 前置通知
* 在目標類的方法執行之前執行。
* 配置文件信息:<aop:after method="before" pointcut-ref="myPointcut3"/>
* 應用:可以對方法的參數來做校驗
2. 最終通知
* 在目標類的方法執行之后執行,如果程序出現了異常,最終通知也會執行。
* 在配置文件中編寫具體的配置:<aop:after method="after" pointcut-ref="myPointcut3"/>
* 應用:例如像釋放資源
3. 后置通知
* 方法正常執行后的通知。
* 在配置文件中編寫具體的配置:<aop:after-returning method="afterReturning" pointcut-ref="myPointcut2"/>
* 應用:可以修改方法的返回值
4. 異常拋出通知
* 在拋出異常后通知
* 在配置文件中編寫具體的配置:<aop:after-throwing method="afterThorwing" pointcut-ref="myPointcut3"/>
* 應用:包裝異常的信息
5. 環繞通知
* 方法的執行前后執行。
* 在配置文件中編寫具體的配置:<aop:around method="around" pointcut-ref="myPointcut2"/>
* 要注意:目標的方法默認不執行,需要使用ProceedingJoinPoint對來讓目標對象的方法執行。