kongzy
2023-10-23 1eeae82f74cbb3469ad8931e45b6fc77a945b912
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
<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:task="http://www.springframework.org/schema/task"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
       http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
 
    <context:component-scan base-package="com.nanometer.smartlab"/>
    <context:annotation-config/>
    <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
 
    <context:property-placeholder location="WEB-INF/config.properties" file-encoding="UTF-8"></context:property-placeholder>
    <bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>/WEB-INF/config.properties</value>
            </list>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
        <property name="ignoreResourceNotFound" value="false"/>
        <property name="fileEncoding" value="UTF-8"/>
    </bean>
 
    <bean id="dateFormat" class="java.text.SimpleDateFormat">
        <constructor-arg value="yyyy-MM-dd HH:mm"/>
    </bean>
 
    <bean id="httpParams" class="org.apache.http.params.SyncBasicHttpParams"></bean>
 
    <bean class="com.nanometer.smartlab.service.HttpParamSetter">
        <property name="httpParams" ref="httpParams"></property>
        <property name="parameters">
            <map>
                <entry key="http.connection.timeout" value-type="java.lang.Integer" value="10000"></entry>
                <entry key="http.socket.timeout" value-type="java.lang.Integer" value="10000"></entry>
            </map>
        </property>
    </bean>
    <bean id="connectionManager" class="org.apache.http.impl.conn.PoolingClientConnectionManager">
        <property name="maxTotal" value="200"></property>
        <property name="defaultMaxPerRoute" value="200"></property>
    </bean>
    <bean id="httpClient" class="org.apache.http.impl.client.DefaultHttpClient" scope="singleton">
        <constructor-arg name="conman" ref="connectionManager"></constructor-arg>
        <constructor-arg name="params" ref="httpParams"></constructor-arg>
    </bean>
 
    <bean id="fireSpringContext" class="com.nanometer.smartlab.service.SmartLabSpringContext"/>
 
    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename">
            <value>message</value>
        </property>
    </bean>
 
    <task:scheduler id="scheduler" pool-size="10"></task:scheduler>
    <task:executor id="executor" pool-size="10-20" queue-capacity="20"></task:executor>
    <task:annotation-driven executor="executor" scheduler="scheduler"/>
 
    <import resource="spring-db.xml"></import>
    <import resource="spring-menu.xml"></import>
</beans>