summaryrefslogtreecommitdiffstats
path: root/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/webapp/WEB-INF/mvc-servlet.xml
blob: f26ce0715daf323fc2574c803cc7ffdcb57de0c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2016-2017, Nokia Corporation

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
<beans xmlns="http://www.springframework.org/schema/beans" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc" 
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
                            http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
                            http://www.springframework.org/schema/mvc
                            http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
                            http://www.springframework.org/schema/context 
                            http://www.springframework.org/schema/context/spring-context-4.3.xsd"
 
       default-lazy-init="true">
       
    <bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location" value="classpath:config.properties"/>
    </bean>
    
    <bean id="adaptorEnv" class="com.nokia.vfcadaptor.common.bo.AdaptorEnv" scope="singleton" >
       <property name = "nslcmIp" value="${nslcmIp}" />
       <property name = "nslcmPort" value="${nslcmPort}" />
       <property name = "catalogIp" value="${catalogIp}" />
       <property name = "catalogPort" value="${catalogPort}" />
       <property name = "cbamIp" value="${cbamIp}" />
       <property name = "grantType" value="${grant_type}" />
       <property name = "clientId" value="${client_id}" />
       <property name = "clientSecret" value="${client_secret}" />
    </bean>
      
	<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
	
	<bean name = "httpClientBuilder" class="com.nokia.vfcadaptor.http.client.HttpClientUtils" factory-method="createHttpClientBuilder"/>

     <context:component-scan base-package="com.nokia.vfcadaptor" />
     
    <!-- 将StringHttpMessageCOnverter的默认编码设为UTF-8 -->
    <mvc:annotation-driven>
        <mvc:message-converters register-defaults="true">
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <constructor-arg value="UTF-8" />
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven> 
    
    <!-- public part end --> 
 
 <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.MySQLDialect
                </prop>
                <prop key="hibernate.show_sql">false</prop>
                <prop key="hibernate.jdbc.batch_size">100</prop>
                <!--<prop key="hibernate.connection.autocommit">false</prop>-->
                <prop key="hibernate.connection.autocommit">true</prop>
                <prop key="hibernate.proxool.pool_alias">proxoolPool</prop>
                <prop key="hibernate.proxool.xml">ProxoolConf.xml</prop>
                <prop key="hibernate.connection.provider_class">org.hibernate.connection.ProxoolConnectionProvider</prop>
                <prop key="hibernate.cache.provider_class">
                         org.hibernate.cache.HashtableCacheProvider
               </prop>
               <prop key="hibernate.connection.release_mode">after_transaction</prop>
            </props>
        </property>

        <!-- mappingResources属性用来列出全部映射文件 -->
         <property name="mappingResources">
             <list>
                 <!-- 配置所有PO映射文件 -->
                 <value>hbm/vnfm_job_execution_map.hbm.xml</value>
             </list>
         </property>
    </bean>
    <!-- 事务管理器 -->
    <bean id="transactionManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory">
            <ref local="sessionFactory" />
        </property>
    </bean>
    
</beans>