[英]Legacy Spring application - what does the pointcut value mean?
I have "inherited" an old legacy Spring application. 我已经“继承”了旧的Spring应用程序。 Currently it is using Spring 2.5 (just upgraded it once), and am looking to further upgrade it to Spring 3. 目前它正在使用Spring 2.5(只升级一次),我希望进一步升级到Spring 3。
I understand most of the application configuration. 我理解大多数应用程序配置。 There is just one part that I am "not 100%" about. 只有一部分我“不是100%”。 I can guess roughly what it might mean but I need to be absolutely sure hence posting this question: 我可以大致猜出它可能意味着什么,但我需要绝对肯定因此发布这个问题:
Here is the configuration snippet (depends on an annotation driven transaction manager not shown here): 这是配置片段(取决于此处未显示的注释驱动的事务管理器):
<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>
My specific two questions are: 我具体的两个问题是:
Thanks for any clarifications. 谢谢你的任何澄清。 Please, no general answers - I need a concrete explanation for this. 请,没有一般性的答案 - 我需要一个具体的解释。
As tx:method
has attribute read-only
with default value as false, means transaction is read/write. 由于tx:method
具有read-only
属性,默认值为false,表示事务是读/写。
So in my opinion, 所以在我看来,
<tx:method name="save*" read-only="false" /> <tx:method name="*" />
is equivalent to 相当于
<tx:method name="*" />
execution(* *..ProductManager.*(..))
means that, "for all the methods in the ProductManager class" execution(* *..ProductManager.*(..))
表示“对于ProductManager类中的所有方法”
tx:advice settings are not additive. tx:建议设置不是附加的。 It says that for all methods beginning with save use the default transaction settings. 它表示对于以save开头的所有方法都使用默认的事务设置。 For the others, this setting means they are NOT read-only transactions. 对于其他人,此设置意味着它们不是只读事务。
For the common sense, one would expect 对于常识,人们会期待
<tx:method name="save*" read-only="false" />
<tx:method name="*" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.