-
Notifications
You must be signed in to change notification settings - Fork 0
/
applicationContext.xml
155 lines (106 loc) · 5.1 KB
/
applicationContext.xml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
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" xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache-3.1.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">
<!-- 自动扫描web包 ,将带有注解的类 纳入spring容器管理 -->
<context:component-scan
base-package="com.tmg.gf.Model;com.tmg.gf.DAOImp;com.tmg.gf.DAO;com.tmg.Model;com.tmg.quartz.Jobs"></context:component-scan>
<!-- Enable AspectJ style of Spring AOP <aop:aspectj-autoproxy />-->
<!-- 引入jdbc配置文件 -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:jdbc.properties</value>
</list>
</property>
</bean>
<!-- different way to configure jdbc.properties <context:property-placeholder
location="jdbc.properties"/> -->
<!-- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close"> -->
<bean id="dataSourceGreenplum" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName.greenplum}"/>
<property name="url" value="${jdbc.url.greenplum}" />
<property name="username" value="${jdbc.username.greenplum}" />
<property name="password" value="${jdbc.password.greenplum}" />
<property name="initialSize" value="1" />
<property name="minIdle" value="1" />
<property name="maxActive" value="5" />
<property name="maxWait" value="60000" />
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<property name="minEvictableIdleTimeMillis" value="300000" />
</bean>
<!-- Aspect
<bean name="testAspect" class="com.tmg.AOP.TestAOP" />
-->
<bean id="GreenplumDAO" class="com.tmg.greenplum.DAOImp.GreenplumDAOImp">
<property name="dataSource" ref="dataSourceGreenplum" />
</bean>
<bean id="ProcessFile" class="com.tmg.Log.ProcessFile" scope="prototype"/>
<bean id="ProcessFileThread" class="com.tmg.Log.ProcessFileThread" scope="prototype"/>
<bean name="ProdABGPLogMonitorJob"
class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="com.tmg.quartz.Jobs.ProdABGPLogMonitorJob" />
<property name="jobDataAsMap">
<map>
<entry key="gpDAOImp" value-ref="GreenplumDAO" />
<entry key="processFileThread" value-ref="ProcessFileThread" />
</map>
</property>
</bean>
<bean name="TestABGPLogMonitorJob"
class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="com.tmg.quartz.Jobs.TstABGPLogMonitorJob" />
<property name="jobDataAsMap">
<map>
<entry key="gpDAOImp" value-ref="GreenplumDAO" />
<entry key="processFileThread" value-ref="ProcessFileThread" />
</map>
</property>
</bean>
<bean id="cronTriggerProdABGPLog"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="ProdABGPLogMonitorJob" />
<property name="cronExpression" value="0 00 08 * * ? *" />
</bean>
<!-- Seconds,Minutes,Hours,Day of month,Month,Day of week,Year -->
<bean id="cronTriggerTestABGPLog"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="TestABGPLogMonitorJob" />
<property name="cronExpression" value="0 30 08 * * ? *" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="schedulerName" value="SchedulerOne" />
<property name="triggers">
<list>
<ref bean="cronTriggerProdABGPLog" />
<ref bean="cronTriggerTestABGPLog" />
</list>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
<prop key="org.quartz.threadPool.threadCount">50</prop>
</props>
</property>
</bean>
</beans>