[英]Legacy Spring application - what does the pointcut value mean?
我已经“继承”了旧的Spring应用程序。 目前它正在使用Spring 2.5(只升级一次),我希望进一步升级到Spring 3。
我理解大多数应用程序配置。 只有一部分我“不是100%”。 我可以大致猜出它可能意味着什么,但我需要绝对肯定因此发布这个问题:
这是配置片段(取决于此处未显示的注释驱动的事务管理器):
<aop:config>
<aop:advisor pointcut="execution(* *..ProductManager.*(..))"
advice-ref="txAdvice" />
</aop:config>
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="save*" />
<tx:method name="*" read-only="false" />
</tx:attributes>
</tx:advice>
我具体的两个问题是:
谢谢你的任何澄清。 请,没有一般性的答案 - 我需要一个具体的解释。
由于tx:method
具有read-only
属性,默认值为false,表示事务是读/写。
所以在我看来,
<tx:method name="save*" read-only="false" /> <tx:method name="*" />
相当于
<tx:method name="*" />
execution(* *..ProductManager.*(..))
表示“对于ProductManager类中的所有方法”
tx:建议设置不是附加的。 它表示对于以save开头的所有方法都使用默认的事务设置。 对于其他人,此设置意味着它们不是只读事务。
对于常识,人们会期待
<tx:method name="save*" read-only="false" />
<tx:method name="*" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.