一个网上的Spring配置文件

转载 2007年09月23日 11:12:00
<?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:util="http://www.springframework.org/schema/util"
        xmlns:lang="http://www.springframework.org/schema/lang"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:jee="http://www.springframework.org/schema/jee"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
        http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
       
        <!-- サーバ用メッセージ -->
        <bean id="messageResource" class="jp.co.ntt.dc.framework.common.msg.MessageResource" />
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="useCodeAsDefaultMessage" value="true" />
            <property name="basenames">
                <list>
                    <value>messages</value>
                    <value>common-messages</value>
                </list>
            </property>
        </bean>

        <!-- システム設定 -->
        <bean id="globalProperty" class="jp.co.ntt.dc.framework.server.common.GlobalProperties"
            factory-method="getInstance">
            <property name="operator">
                <bean class="jp.co.ntt.dc.framework.server.common.SystemPropertiesOperator" parent="daoBase" />
            </property>
        </bean>
        <!-- システム設定用DAO -->
        <bean name="propertiesOperator" class="jp.co.ntt.dc.framework.server.common.SystemPropertiesOperator"
            parent="daoBase" />

        <!-- SQLリソース -->
        <bean id="sqlResource" class="jp.co.ntt.dc.framework.server.config.SQLResource" init-method="init">
            <property name="locations">
                <list>
                    <value>classpath:fw.hql.xml</value>
                    <value>classpath:equip.hql.xml</value>
                    <value>classpath:filter.hql.xml</value>
                    <value>classpath:job.hql.xml</value>
                    <value>classpath:kdm.hql.xml</value>
                    <value>classpath:key.hql.xml</value>
                    <value>classpath:license.hql.xml</value>
                    <value>classpath:log.hql.xml</value>
                    <value>classpath:manage.hql.xml</value>
                    <value>classpath:master.hql.xml</value>
                    <value>classpath:theater.hql.xml</value>
                    <value>classpath:theaterstatus.hql.xml</value>
                    <value>classpath:common.hql.xml</value>
                    <value>classpath:sequence.hql.xml</value>
                </list>
            </property>
        </bean>

        <!-- フレームワーク用設定 -->
        <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
            <property name="locations">
                <list>
                    <value>classpath:system.properties</value>
                </list>
            </property>
        </bean>

        <!-- データソースの設定 -->
        <jee:jndi-lookup id="dataSource" jndi-name="java:XADS/SecurityCenter"/>

        <!-- Hibernate SessionFactory -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource" ref="dataSource" />
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                    <prop key="hibernate.show_sql">true</prop>
                </props>
            </property>

            <!-- Must references all OR mapping files.-->
            <property name="mappingResources">
                <list>
                    <value>common.xml</value>
                    <value>securityCenter.xml</value>
                </list>
            </property>
        </bean>

        <!-- トランザクションの設定 -->
        <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" />
        <tx:advice id="transactionAdvice" transaction-manager="transactionManager">
            <tx:attributes>
                <tx:method name="execute" />
                <tx:method name="send" />
            </tx:attributes>
        </tx:advice>

        <!-- トランザクション用AOPの設定 -->
        <aop:config>
            <aop:pointcut id="businessLogic"
                expression="execution(* jp.co.ntt.dc.framework.server.action.IActionBase.execute(..))" />
            <aop:advisor advice-ref="transactionAdvice" pointcut-ref="businessLogic" />
        </aop:config>

        <!-- DBアクセスヘルプ -->
        <bean id="dbHelper" class="jp.co.ntt.dc.framework.server.dao.DBAccessHelper">
            <property name="sessionFactory" ref="sessionFactory" />
        </bean>

        <!-- DAOの親クラス -->
        <bean id="daoBase" class="jp.co.ntt.dc.framework.server.dao.IDaoBase" abstract="true">
            <property name="dbHelper" ref="dbHelper" />
        </bean>

        <!-- Actionの親クラス -->
        <bean id="actionBase" class="jp.co.ntt.dc.framework.server.action.IActionBase" abstract="true">
            <property name="daoMap">
                <map>
                    <entry key="masterDAO">
                        <ref bean="masterDAO" />
                    </entry>
                    <entry key="CommonDAO">
                        <ref bean="CommonDAO" />
                    </entry>
                </map>
            </property>
        </bean>

        <!-- マスタテーブル用DAO -->
        <bean name="masterDAO" class="jp.co.ntt.dc.business.server.sc.common.dao.MasterDao" parent="daoBase" />

        <!-- システム共通DAO -->
        <bean name="CommonDAO" class="jp.co.ntt.dc.framework.server.dao.CommonDao" parent="daoBase" />

        <!-- Validateアクション -->
        <bean name="/ActionValidate" class="jp.co.ntt.dc.framework.server.action.ActionValidate" init-method="init">
            <property name="actionValidateDAO">
                <ref bean="actionValidateDAO" />
            </property>
        </bean>
        <!-- Validateアクション用のDAO -->
        <bean name="actionValidateDAO" class="jp.co.ntt.dc.framework.server.dao.ActionValidateDao" parent="daoBase" />

        <!-- RMIのサービス -->
        <bean name="remotingService" class="jp.co.ntt.dc.framework.server.handler.RemotingController">
            <property name="handlerMapping" ref="remotingMapping" />
        </bean>
        <!-- RMI Mapping -->
        <bean name="remotingMapping" class="jp.co.ntt.dc.framework.server.handler.HandlerMapping" />
        <!-- アクションの自動登録Bean -->
        <bean class="jp.co.ntt.dc.framework.server.handler.ActionBeanAutoRegistrant">
            <property name="handlerMapping" ref="remotingMapping" />
        </bean>
        <!-- RMIのインタフェース -->
        <bean name="/RemotingService" class="jp.co.ntt.dc.framework.server.handler.CenterAppHttpInvokerServiceExporter">
            <property name="service" ref="remotingService" />
            <property name="serviceInterface" value="jp.co.ntt.dc.framework.common.service.IRemotingService" />
        </bean>

        <!-- **Http Invokers Client** -->
        <!-- **Http Invokers FactoryBean** -->
        <bean id="remotingFactoryBean" class="jp.co.ntt.dc.framework.common.remoting.DCHttpInvokerProxyFactoryBean">
            <property name="serviceUrl"
                value="http://${server.ip}:${server.port}/${server.module}/${server.service.remoting}" />
            <property name="serviceInterface" value="jp.co.ntt.dc.framework.common.service.IRemotingService" />
        </bean>

        <!-- **Http Invokers RemotingProxy** -->
        <bean id="remotingProxy" class="jp.co.ntt.dc.framework.server.remoting.RemotingProxy">
            <property name="remotingFactoryBean" ref="remotingFactoryBean" />
            <property name="context" ref="context" />
        </bean>

        <!-- **Http Invokers Client Helper** -->
        <bean id="remotingHelper" class="jp.co.ntt.dc.framework.server.remoting.RemotingHelper">
            <property name="remotingProxy" ref="remotingProxy" />
        </bean>

        <!-- **Context** -->
        <bean id="context" class="jp.co.ntt.dc.framework.server.context.DCContext">
            <property name="defaultUserId" value="${default.userid}" />
            <property name="defaultUserPswd" value="${default.password}" />
            <property name="jndiMap">
                <map>
                    <entry key="java.naming.factory.initial" value="${java.naming.factory.initial}" />
                    <entry key="java.naming.factory.url.pkgs" value="${java.naming.factory.url.pkgs}" />
                    <entry key="java.naming.provider.url" value="${java.naming.provider.url}" />
                </map>
            </property>
        </bean>

    </beans>
 

spring cloud与spring boot实战

本课程主要从四个章节进行讲解: 1.微服务架构入门 2.spring cloud 基础入门 3.实战Spring Boot 4.注册中心eureka。 请加QQ群:274033905(群名:《spring cloud 实战》),免费获取课件资料哦 本课程的知识目录和思维导图详细介绍地址:http://blog.csdn.net/bobo0218bo/article/details/78442245
  • 2017年10月15日 20:49

spring配置文件

  • 2018年03月23日 11:55
  • 4KB
  • 下载

spring文件头复制的来源

其实从文件头可以看出这些xsd文件都是spring官网的一个目录下,http://www.springframework.org/schema/,所以打开这个地址就可以看到各个版本的xsd了,根据自己...
  • f1370335844
  • f1370335844
  • 2017-11-13 11:33:13
  • 66

Spring配置文件集合

  • 2017年09月18日 23:13
  • 6KB
  • 下载

spring boot配置文件参数详解

  • 2018年03月26日 13:34
  • 15KB
  • 下载

spring的配置文件中引入其他配置

1.引入        我们在做项目的时候会遇到这种情况        1)有些参数在某些阶段中是常量              比如在开发阶段连接数据库时的连接driverClass,url,use...
  • cpf2016
  • cpf2016
  • 2015-05-12 15:49:55
  • 1902

Spring配置文件命名空间

xmlns 是xml namespace的缩写,也就是XML命名空间,xmlns 属性可以在文档中定义一个或多个可供选择的命名空间   ...
  • hbiao68
  • hbiao68
  • 2013-12-04 10:04:02
  • 1239

Spring有多个配置文件整合一个

spring多个配置文件如何放到一起:
  • xiejunna
  • xiejunna
  • 2017-08-19 17:51:18
  • 161

spring和springmvc的配置文件整合

spring和springmvc如何集成这里就不多做介绍了,本人在集成过程中,发现一个很严重的“小问题”。 在springmvc的controller中,是可以@Autowire任意的bean的,这...
  • sxyandapp
  • sxyandapp
  • 2016-05-11 16:57:08
  • 5498

spring中引用多个配置文件

中间以逗号分开即可:&amp;lt;context:property-placeholder location=&quot;classpath:/jdbc.properties,classpath:/...
  • z_alvin
  • z_alvin
  • 2018-02-10 15:08:15
  • 31
收藏助手
不良信息举报
您举报文章:一个网上的Spring配置文件
举报原因:
原因补充:

(最多只允许输入30个字)