Spring 【Aspectj】 pojo+xml 配置方式

面向观众的增强型演出体验
本文详细介绍了如何使用AOP技术为观众提供更丰富、更个性化的演出体验,包括座位选择、手机关闭、退票需求处理、鼓掌互动及演出结束后离场等关键环节的优化。

<!--
观众(通知) --> <bean id="audience" class="aspectj.Audience"/> <!-- 通过配置元素 将 pojo变成一个切面类 --> <aop:config> <aop:aspect ref="audience"> <!-- 引入通知 ,types-matching:指定给哪些类增加新的属性与方法 implement-interface: 新接口 default-impl:新接口的默认实现--> <aop:declare-parents types-matching="aspectj.Singer" implement-interface="aspectj.IHeight" default-impl="aspectj.HeightImpl"/> <!-- 定义切入点, (重用) --> <aop:pointcut id="audiencePointcut" expression="execution (* aspectj.Performer.*(..))"/> <!-- 各种切入 --> <aop:before method="takeSeats" pointcut-ref="audiencePointcut"/> <aop:before method="turnOffCellPhone" pointcut-ref="audiencePointcut"/> <aop:after-throwing method="demandRefund" pointcut-ref="audiencePointcut" throwing="e"/> <aop:after-returning method="applaud" pointcut-ref="audiencePointcut" returning="ret"/> <aop:after method="goHome" pointcut-ref="audiencePointcut"/> <aop:around method="doWatch" pointcut-ref="audiencePointcut"/> </aop:aspect> </aop:config>

 

转载于:https://www.cnblogs.com/luffya/p/3477712.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值