beautypg.com

HP Integrity NonStop H-Series User Manual

Page 377

background image

4.

AOP Proxy Factory Bean: It creates an AOP proxy factory bean that contains the business
interface and the implementation class as the target.

class = "org.springframework.aop.framework.ProxyFactoryBean">

com.hp.empinfo.service.IEmployeeDao




5.

Bean Instance for the implementation class: It creates a bean for the implementation class
and contains a reference to the data source.





6.

XML namespace and schema location: The namespace and schema locations of the

<aop:config>

and

<tx:advice>

tags must be defined as follows:

xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop=http://www.springframework.org/schema/aop”

and

xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd"

After modification, the

applicationContext.xml

file should appear as:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">





class = "org.springframework.aop.framework.ProxyFactoryBean">

com.hp.empinfo.service.IEmployeeDao














class="org.springframework.jdbc.datasource.DriverManagerDataSource"
destroy-method="close">

Example of Using Spring Transaction Manager

377

This manual is related to the following products: