备份配置 - spring

<?xml version="1.0" encoding="UTF-8"?>
<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"
		xmlns:tx="http://www.springframework.org/schema/tx"
		xsi:schemaLocation="
			http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
			http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
			http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
        
        <aop:aspectj-autoproxy/>
        <tx:annotation-driven transaction-manager="txManager"/>

        

        
        
        
        
        
        <import resource="applicationContext-dept.xml"/>
        
        <bean id="impl1" class="com.ibm.springtest.ioc.Impl1" depends-on="conn" scope="singleton" init-method="myInit" destroy-method="myDestroy">
             <lookup-method bean="conn" name="getConn"/>
             <property name="str" value="china"></property>
            
             <property name="list">
                    <list>
                        <value>111111111</value>
                        <value>sssssssss</value>
                    </list>
             </property>
             <property name="map">
                    <map>
                          <entry>
                               <key><value>a1</value></key>
                               <value>a11111111111</value>
                          </entry>
                          <entry>
                               <key><value>a2</value></key>
                               <ref bean="conn"/>
                          </entry>
                    </map>
             </property>
             <property name="ms" ref="messageSource"></property>
             
        </bean>
        
        <bean id="conn" class="com.ibm.springtest.ioc.DbConn" scope="prototype" lazy-init="true"></bean>
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basenames">
            <list>
                 <value>abc</value>
            </list>
            </property>
            
        </bean>
        
        <bean id="myTarget" class="com.ibm.springtest.ht.MyTarget"/>
        <bean id="myAdvice" class="com.ibm.springtest.ht.MyAdvice"/>
        
<!--          
        <aop:config >

				  <aop:aspect id="myAspect" ref="myAdvice">
				    <aop:pointcut id="myPointcut"
				        expression="execution(* com.ibm.springtest.ht.MyTarget.test(..))"/>
				    <aop:after
				       pointcut-ref="myPointcut"
				       method="ttt"/>
				  </aop:aspect>
				  
				  
				  <aop:aspect id="myAspect2" ref="myAdvice">
				    <aop:pointcut id="myPointcut2"
				        expression="execution(* com.ibm.springtest.ht.MyTarget.t(..))"/>
				    <aop:before
				       pointcut-ref="myPointcut2"
				       method="fun"/>
				  </aop:aspect>
		
		</aop:config>

-->        
			    <bean id="myDataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
			        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
			        <property name="url" value="jdbc:mysql://localhost:3306/mydb"/>
			        <property name="username" value="root"/>
			        <property name="password" value="root"/>
			    </bean>

                 <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
					    <property name="dataSource" ref="myDataSource"/>
					    <property name="mappingResources">
					      <list>
					        <value>com/ibm/springtest/dao/UserModel.hbm.xml</value>
					      </list>
					    </property>
					    <property name="hibernateProperties">
					      <value>
					        hibernate.dialect=org.hibernate.dialect.MySQLDialect
					        hibernate.show_sql=true
					        hibernate.format_sql=true
					      </value>
					    </property>
				  </bean>

                 

        <bean id="userDao" class="com.ibm.springtest.dao.JdbcImpl">
            <property name="dataSource" ref="myDataSource"></property>
        </bean>
        
        <bean id="userDao2" class="com.ibm.springtest.dao.HibernateImpl">
            <property name="sf" ref="mySessionFactory"></property>
        </bean>
        
        <bean id="userEbi" class="com.ibm.springtest.dao.UserEbo">
            <property name="userDao" ref="userDao2"></property>
        </bean>
        
        
          
        <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		  <property name="dataSource" ref="myDataSource"/>
		</bean>
        
        <!--
	      <tx:advice id="txAdvice" transaction-manager="txManager">
			  <tx:attributes>
			    <tx:method name="get*" read-only="true"/>
			    <tx:method name="*"/>
			  </tx:attributes>
		  </tx:advice>
		  
		  <tx:advice id="txAdvice2" transaction-manager="txManager">
			  <tx:attributes>
			    <tx:method name="get*" read-only="true"/>
			    <tx:method name="*" propagation="REQUIRES_NEW"/>
			  </tx:attributes>
		  </tx:advice>
		  
		  
	    <aop:config>
		    <aop:pointcut id="myPointcut"  expression="execution(* com.ibm.springtest.dao.*.*(..))"/>
		    <aop:pointcut id="myPointcut2"  expression="execution(* com.ibm.springtest.dao.*.*(..))"/>
		    
		    
		    <aop:advisor pointcut-ref="myPointcut" advice-ref="txAdvice"/>
		    <aop:advisor pointcut-ref="myPointcut2" advice-ref="txAdvice2"/>
		</aop:config>

    -->
        
        
</beans>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值