新人求助,如何给指定的<bean />添加自定义的aop?
一般aop通过excution来做,但我希望在配置<bean>的时候按需要把aop加进去,这样更精确一些,因为excution是通过名字来匹配的,需要达成统一的约定,另外不要注解式。求各位指导,谢谢了。 --------------------编程问答-------------------- <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="soapHander"
class="com.huawei.ngin.mo.bmp.commons.aop.SoapAopHandler" />
<aop:config>
<aop:aspect ref="soapHander">
<aop:pointcut id="soapOperation"
expression="execution(* com.huawei.ngin.mo.bmp.usergroupmgr.service.impl.UserGroupServImpl.display*(..))||
execution(* com.huawei.ngin.mo.bmp.usergroupmgr.service.impl.UserGroupServImpl.list*(..))||
execution(* com.huawei.ngin.mo.bmp.enterprisemgr.service.impl.EnterpriseServImpl.display*(..))||
execution(* com.huawei.ngin.mo.bmp.enterprisemgr.service.impl.EnterpriseServImpl.list*(..))||
execution(* com.huawei.ngin.mo.bmp.consumptionprofilemgr.service.impl.ConsumptionProfileServImpl.list*(..))||
execution(* com.huawei.ngin.mo.bmp.consumptionprofilemgr.service.impl.ConsumptionProfileServImpl.display*(..))||
execution(* com.huawei.ngin.mo.bmp.membermgr.service.impl.MemberServImpl.display*(..))||
execution(* com.huawei.ngin.mo.bmp.membermgr.service.impl.MemberServImpl.list*(..))
" />
<aop:around pointcut-ref="soapOperation"
method="soapOperation" />
</aop:aspect>
</aop:config>
</beans> --------------------编程问答--------------------
补充:Java , Java EE