Spring通知
Interception Around通知 MethodInterceptor类(方法执行前后通知)
Before通知 MethodBeforeAdvice类(方法执行前通知)
After Returning通知 AfterReturningAdvice类(方法执行后通知)
Throw通知 ThrowsAdvice类(方法执行抛出异常时通知)
Introduction通知 IntroductionAdvisor类和IntroductionInterceptor类(方法执行完通知)
具体事例:
LogAround implements MethodInterceptor
TimeBook implements TimeBookInterface
配置文档 Interception Around通知
1 <!--以下是使用Spring AOP实现日志--> 2 <bean id="log" class="com.gc.antion.LogAround"/> 3 <bean id="timeBook" class="com.gc.action.TimeBook"/> 4 <bean id="logProxy" class="org.springframework.aop.framework.ProxyFactoryBean"> 5 <property name="proxyInterfaces"> 6 <value>com.gc.impl.TimeBookInterface</value> 7 </property> 8 <!--指定要代理的类--> 9 <property name="interceptorNames"> 10 <list> 11 <value>log</value> 12 <list> 13 </property> 14 </bean>