| Sign In/My Account | View Cart |
| Article: |
An Introduction to Aspect-Oriented Programming with the Spring Framework, Part 1 | |
| Subject: | The diagrams are wrong? | |
| Date: | 2004-08-19 21:24:37 | |
| From: | russellmiles | |
|
Response to: The diagrams are wrong?
|
||
|
Hi Patrick,
|
||
Showing messages 1 through 5 of 5.
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"> <ref local="sessionFactory" /> </property>
</bean>
<bean id="loggingThrowsAdvice" class="com.myapp.aop.LoggingThrowsAdvice">
</bean>
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
<property name="preInterceptors">
<list>
<ref local="loggingThrowsAdvice" />
</list>
</property>
</bean>
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"> <ref local="sessionFactory" /> </property>
</bean>
<bean id="loggingThrowsAdvice" class="com.myapp.aop.LoggingThrowsAdvice">
</bean>
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
<property name="preInterceptors">
<list>
<ref local="loggingThrowsAdvice" />
</list>
</property>
</bean>
Great work by you people. I have a simple question.
We have given instructions on how to configure for Transactionality by using TransactionProxyFactoryBean and also we have given instructions on how to configure ProxyFactoryBean for Advices.
My requirement is to apply both of these to the same UserManagerDelegate class and if I do them separate (as separate beans in .xml file), then I am only looking up for one bean ctx.getBean("UserManager"); and this only applies one of the above 2 configurations. If I use it for Transactions, it doesn't work for other 'before' and 'after' method advices. If I use this for 'before'&'after' method advices, then it doesn't work for Transactions.
How can I configure my UserManager (interface) and UserManagerImpl (implementation) to take care of both (a) Transactionality and (b) before&after method advices.
Please help.
Thank you very much.