applicationContext.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to Jasig under one or more contributor license
  4. agreements. See the NOTICE file distributed with this work
  5. for additional information regarding copyright ownership.
  6. Jasig licenses this file to you under the Apache License,
  7. Version 2.0 (the "License"); you may not use this file
  8. except in compliance with the License. You may obtain a
  9. copy of the License at the following location:
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. -->
  18. <beans xmlns="http://www.springframework.org/schema/beans"
  19. xmlns:task="http://www.springframework.org/schema/task"
  20. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21. xmlns:context="http://www.springframework.org/schema/context"
  22. xmlns:tx="http://www.springframework.org/schema/tx"
  23. xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
  24. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  25. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
  26. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  27. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
  28. http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">
  29. <description>
  30. This is the main Spring configuration file with some of the main "core" classes defined. You shouldn't really
  31. modify this unless you
  32. know what you're doing!
  33. </description>
  34. <!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入. @Controller的Bean注入在spring-mvc.xml中自动注册 -->
  35. <context:component-scan base-package="com.jsjty">
  36. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  37. </context:component-scan>
  38. <context:annotation-config/>
  39. <!--
  40. Including this aspectj-autoproxy element will cause spring to automatically
  41. create proxies around any beans defined in this file that match the pointcuts
  42. of any aspects defined in this file.
  43. -->
  44. <aop:aspectj-autoproxy/>
  45. <!--
  46. Declare the TimingAspect that we want to weave into the other beans
  47. defined in this config file.
  48. -->
  49. <bean id="timingAspect" class="org.perf4j.log4j.aop.TimingAspect"/>
  50. <!-- Message source for this context, loaded from localized "messages_xx" files -->
  51. <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"
  52. p:basename="messages"/>
  53. <bean
  54. id="servicesManager"
  55. class="org.jasig.cas.services.DefaultServicesManagerImpl">
  56. <constructor-arg index="0" ref="serviceRegistryDao"/>
  57. </bean>
  58. <!--
  59. Job to periodically reload services from service registry.
  60. This job is needed for a clustered CAS environment since service changes
  61. in one CAS node are not known to the other until a reload.
  62. -->
  63. <bean id="serviceRegistryReloaderJobDetail"
  64. class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"
  65. p:targetObject-ref="servicesManager"
  66. p:targetMethod="reload"/>
  67. <bean id="periodicServiceRegistryReloaderTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean"
  68. p:jobDetail-ref="serviceRegistryReloaderJobDetail"
  69. p:startDelay="${service.registry.quartz.reloader.startDelay:120000}"
  70. p:repeatInterval="${service.registry.quartz.reloader.repeatInterval:120000}"/>
  71. <bean id="httpClient" class="org.jasig.cas.util.HttpClient"
  72. p:readTimeout="5000"
  73. p:connectionTimeout="5000"/>
  74. <bean id="noRedirectHttpClient" class="org.jasig.cas.util.HttpClient" parent="httpClient"
  75. p:followRedirects="false" />
  76. <bean id="persistentIdGenerator"
  77. class="org.jasig.cas.authentication.principal.ShibbolethCompatiblePersistentIdGenerator"
  78. p:salt="casrocks"/>
  79. <!-- CentralAuthenticationService -->
  80. <bean id="centralAuthenticationService" class="org.jasig.cas.CentralAuthenticationServiceImpl"
  81. p:ticketGrantingTicketExpirationPolicy-ref="grantingTicketExpirationPolicy"
  82. p:serviceTicketExpirationPolicy-ref="serviceTicketExpirationPolicy"
  83. p:authenticationManager-ref="authenticationManager"
  84. p:ticketGrantingTicketUniqueTicketIdGenerator-ref="ticketGrantingTicketUniqueIdGenerator"
  85. p:ticketRegistry-ref="ticketRegistry"
  86. p:servicesManager-ref="servicesManager"
  87. p:persistentIdGenerator-ref="persistentIdGenerator"
  88. p:uniqueTicketIdGeneratorsForService-ref="uniqueIdGeneratorsMap"/>
  89. <bean id="proxy10Handler" class="org.jasig.cas.ticket.proxy.support.Cas10ProxyHandler"/>
  90. <bean id="proxy20Handler" class="org.jasig.cas.ticket.proxy.support.Cas20ProxyHandler"
  91. p:httpClient-ref="httpClient"
  92. p:uniqueTicketIdGenerator-ref="proxy20TicketUniqueIdGenerator"/>
  93. <!-- ADVISORS -->
  94. <bean id="advisorAutoProxyCreator"
  95. class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/>
  96. <bean id="validationAnnotationBeanPostProcessor" class="org.jasig.cas.util.CustomBeanValidationPostProcessor"
  97. p:afterInitialization="true" />
  98. <!-- The scheduler bean wires up any triggers that define scheduled tasks -->
  99. <bean id="scheduler" class="org.jasig.cas.util.AutowiringSchedulerFactoryBean"/>
  100. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  101. destroy-method="close" lazy-init="false">
  102. <property name="driverClassName">
  103. <value>oracle.jdbc.driver.OracleDriver</value>
  104. </property>
  105. <property name="url">
  106. <value>${config.jdbc.url}</value>
  107. </property>
  108. <property name="username">
  109. <value>${config.jdbc.username}</value>
  110. </property>
  111. <property name="password">
  112. <value>${config.jdbc.password}</value>
  113. </property>
  114. <!-- Connection Pooling Info -->
  115. <!-- 连接池启动时的初始值 -->
  116. <!-- <property name="initialSize" value="${dbcp.initialSize}" /> -->
  117. <!-- 最大连接数据库连接数,设置为0时,表示没有限制 -->
  118. <property name="maxActive" value="100" />
  119. <!-- 最大等待连接中的数量,设置为0时,表示没有限制 -->
  120. <property name="maxIdle" value="10" />
  121. <!-- 最小等待连接中的数量,设置为0时,表示没有限制 -->
  122. <property name="minIdle" value="5" />
  123. <!-- sql验证 主要是防止重启数据库时,去先前已有的连接时报错,这个是在需要连接验证时用到 -->
  124. <property name="validationQuery" value="select 1 from dual" />
  125. <!-- 取出连接时进行有效性验证 默认是true,设置为false,提高性能 -->
  126. <property name="testOnBorrow" value="false" />
  127. <!-- 最大等待时间 -->
  128. <property name="maxWait" value="60000" />
  129. <!-- 设置从数据源中返回的连接是否采用自动提交机制,默认值为 true -->
  130. <property name="defaultAutoCommit" value="false" />
  131. <!-- 每30秒运行一次空闲连接回收器,如果当前连接数小于minIdle会去创建 -->
  132. <property name="timeBetweenEvictionRunsMillis" value="300000" />
  133. <!-- 池中的连接空闲30分钟后被回收 -->
  134. <property name="minEvictableIdleTimeMillis" value="1800000" />
  135. </bean>
  136. <bean id="aqdataSource" class="org.apache.commons.dbcp.BasicDataSource"
  137. destroy-method="close" lazy-init="false">
  138. <property name="driverClassName">
  139. <value>oracle.jdbc.driver.OracleDriver</value>
  140. </property>
  141. <property name="url">
  142. <value>${config.jdbc.aqurl}</value>
  143. </property>
  144. <property name="username">
  145. <value>${config.jdbc.aqusername}</value>
  146. </property>
  147. <property name="password">
  148. <value>${config.jdbc.aqpassword}</value>
  149. </property>
  150. <!-- Connection Pooling Info -->
  151. <!-- 连接池启动时的初始值 -->
  152. <!-- <property name="initialSize" value="${dbcp.initialSize}" /> -->
  153. <!-- 最大连接数据库连接数,设置为0时,表示没有限制 -->
  154. <property name="maxActive" value="100" />
  155. <!-- 最大等待连接中的数量,设置为0时,表示没有限制 -->
  156. <property name="maxIdle" value="10" />
  157. <!-- 最小等待连接中的数量,设置为0时,表示没有限制 -->
  158. <property name="minIdle" value="5" />
  159. <!-- sql验证 主要是防止重启数据库时,去先前已有的连接时报错,这个是在需要连接验证时用到 -->
  160. <property name="validationQuery" value="select 1 from dual" />
  161. <!-- 取出连接时进行有效性验证 默认是true,设置为false,提高性能 -->
  162. <property name="testOnBorrow" value="false" />
  163. <!-- 最大等待时间 -->
  164. <property name="maxWait" value="60000" />
  165. <!-- 设置从数据源中返回的连接是否采用自动提交机制,默认值为 true -->
  166. <property name="defaultAutoCommit" value="false" />
  167. <!-- 每30秒运行一次空闲连接回收器,如果当前连接数小于minIdle会去创建 -->
  168. <property name="timeBetweenEvictionRunsMillis" value="300000" />
  169. <!-- 池中的连接空闲30分钟后被回收 -->
  170. <property name="minEvictableIdleTimeMillis" value="1800000" />
  171. </bean>
  172. <bean id="aisdataSource" class="org.apache.commons.dbcp.BasicDataSource"
  173. destroy-method="close" lazy-init="false">
  174. <property name="driverClassName">
  175. <value>oracle.jdbc.driver.OracleDriver</value>
  176. </property>
  177. <property name="url">
  178. <value>${config.jdbc.aisurl}</value>
  179. </property>
  180. <property name="username">
  181. <value>${config.jdbc.aisusername}</value>
  182. </property>
  183. <property name="password">
  184. <value>${config.jdbc.aispassword}</value>
  185. </property>
  186. <!-- Connection Pooling Info -->
  187. <!-- 连接池启动时的初始值 -->
  188. <!-- <property name="initialSize" value="${dbcp.initialSize}" /> -->
  189. <!-- 最大连接数据库连接数,设置为0时,表示没有限制 -->
  190. <property name="maxActive" value="100" />
  191. <!-- 最大等待连接中的数量,设置为0时,表示没有限制 -->
  192. <property name="maxIdle" value="10" />
  193. <!-- 最小等待连接中的数量,设置为0时,表示没有限制 -->
  194. <property name="minIdle" value="5" />
  195. <!-- sql验证 主要是防止重启数据库时,去先前已有的连接时报错,这个是在需要连接验证时用到 -->
  196. <property name="validationQuery" value="select 1 from dual" />
  197. <!-- 取出连接时进行有效性验证 默认是true,设置为false,提高性能 -->
  198. <property name="testOnBorrow" value="false" />
  199. <!-- 最大等待时间 -->
  200. <property name="maxWait" value="60000" />
  201. <!-- 设置从数据源中返回的连接是否采用自动提交机制,默认值为 true -->
  202. <property name="defaultAutoCommit" value="false" />
  203. <!-- 每30秒运行一次空闲连接回收器,如果当前连接数小于minIdle会去创建 -->
  204. <property name="timeBetweenEvictionRunsMillis" value="300000" />
  205. <!-- 池中的连接空闲30分钟后被回收 -->
  206. <property name="minEvictableIdleTimeMillis" value="1800000" />
  207. </bean>
  208. <!-- OA数据源 -->
  209. <bean id="oadataSource" class="org.apache.commons.dbcp.BasicDataSource"
  210. destroy-method="close" lazy-init="false">
  211. <property name="driverClassName">
  212. <value>oracle.jdbc.driver.OracleDriver</value>
  213. </property>
  214. <property name="url">
  215. <value>${config.jdbc.oaurl}</value>
  216. </property>
  217. <property name="username">
  218. <value>${config.jdbc.oausername}</value>
  219. </property>
  220. <property name="password">
  221. <value>${config.jdbc.oapassword}</value>
  222. </property>
  223. <!-- Connection Pooling Info -->
  224. <!-- 连接池启动时的初始值 -->
  225. <!-- <property name="initialSize" value="${dbcp.initialSize}" /> -->
  226. <!-- 最大连接数据库连接数,设置为0时,表示没有限制 -->
  227. <property name="maxActive" value="100" />
  228. <!-- 最大等待连接中的数量,设置为0时,表示没有限制 -->
  229. <property name="maxIdle" value="10" />
  230. <!-- 最小等待连接中的数量,设置为0时,表示没有限制 -->
  231. <property name="minIdle" value="5" />
  232. <!-- sql验证 主要是防止重启数据库时,去先前已有的连接时报错,这个是在需要连接验证时用到 -->
  233. <property name="validationQuery" value="select 1 from dual" />
  234. <!-- 取出连接时进行有效性验证 默认是true,设置为false,提高性能 -->
  235. <property name="testOnBorrow" value="false" />
  236. <!-- 最大等待时间 -->
  237. <property name="maxWait" value="60000" />
  238. <!-- 设置从数据源中返回的连接是否采用自动提交机制,默认值为 true -->
  239. <property name="defaultAutoCommit" value="false" />
  240. <!-- 每30秒运行一次空闲连接回收器,如果当前连接数小于minIdle会去创建 -->
  241. <property name="timeBetweenEvictionRunsMillis" value="300000" />
  242. <!-- 池中的连接空闲30分钟后被回收 -->
  243. <property name="minEvictableIdleTimeMillis" value="1800000" />
  244. </bean>
  245. <!--GK,建设经营,智能监管 -->
  246. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  247. <property name="dataSource" ref="dataSource" />
  248. </bean>
  249. <!--OA -->
  250. <bean id="oajdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  251. <property name="dataSource" ref="oadataSource" />
  252. </bean>
  253. <!--事务配置 -->
  254. <bean id="txManager"
  255. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  256. <property name="dataSource" ref="dataSource" />
  257. <qualifier value="txManager"></qualifier>
  258. </bean>
  259. <!--事务配置 -->
  260. <bean id="txManagerAQ"
  261. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  262. <property name="dataSource" ref="aqdataSource" />
  263. <qualifier value="txManagerAQ"></qualifier>
  264. </bean>
  265. <!--事务配置 -->
  266. <bean id="txManagerAIS"
  267. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  268. <property name="dataSource" ref="aisdataSource" />
  269. <qualifier value="txManagerAIS"></qualifier>
  270. </bean>
  271. <!--事务配置 -->
  272. <bean id="txManagerOA"
  273. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  274. <property name="dataSource" ref="oadataSource" />
  275. <qualifier value="txManagerOA"></qualifier>
  276. </bean>
  277. <!-- 事务注解驱动,标注@Transactional的类和方法将具有事务性 -->
  278. <tx:annotation-driven transaction-manager="txManager" />
  279. <!-- 安全事务注解驱动,标注@Transactional的类和方法将具有事务性 -->
  280. <tx:annotation-driven transaction-manager="txManagerAQ" />
  281. <!-- AIS事务注解驱动,标注@Transactional的类和方法将具有事务性 -->
  282. <tx:annotation-driven transaction-manager="txManagerAIS" />
  283. <tx:annotation-driven transaction-manager="txManagerOA" />
  284. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  285. <property name="dataSource" ref="dataSource"></property>
  286. <property name="configLocation" value="classpath:mybatis/myBatis.xml" />
  287. </bean>
  288. <!--安全-->
  289. <bean id="aqsqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  290. <property name="dataSource" ref="aqdataSource"></property>
  291. <property name="configLocation" value="classpath:mybatis/aqMyBatis.xml" />
  292. </bean>
  293. <!--岸基-->
  294. <bean id="aissqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  295. <property name="dataSource" ref="aisdataSource"></property>
  296. <property name="configLocation" value="classpath:mybatis/aisMyBatis.xml" />
  297. </bean>
  298. <!-- oa -->
  299. <bean id="oasqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  300. <property name="dataSource" ref="oadataSource"></property>
  301. <property name="configLocation" value="classpath:mybatis/oaMyBatis.xml" />
  302. </bean>
  303. <!-- 扫描mapper.java -->
  304. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  305. <property name="basePackage" value="com.jsjty.**.mapper" />
  306. <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
  307. </bean>
  308. <!-- 扫描mappers.java -->
  309. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  310. <property name="basePackage" value="com.jsjty.**.mappers" />
  311. <property name="sqlSessionFactoryBeanName" value="aqsqlSessionFactory" />
  312. </bean>
  313. <!-- 扫描mapperais.java -->
  314. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  315. <property name="basePackage" value="com.jsjty.**.mapperais" />
  316. <property name="sqlSessionFactoryBeanName" value="aissqlSessionFactory" />
  317. </bean>
  318. <!-- 扫描mapperoa.java -->
  319. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  320. <property name="basePackage" value="com.jsjty.**.mapperoa" />
  321. <property name="sqlSessionFactoryBeanName" value="oasqlSessionFactory" />
  322. </bean>
  323. <!-- 定时器配置 -->
  324. <!-- <bean id="schedule" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
  325. <property name="triggers">
  326. <list>
  327. <ref bean="AISSsxxTb"/>
  328. <ref bean="AISLastSsxxTb"/>
  329. </list>
  330. </property>
  331. </bean> -->
  332. <!-- <bean id="AISSsxxTb" class="org.springframework.scheduling.quartz.CronTriggerBean">
  333. <property name="jobDetail" ref="AISSsxxTbSxl" />
  334. <property name="cronExpression" value="0 0 0/2 * * ?" />
  335. </bean>
  336. <bean id="AISLastSsxxTb" class="org.springframework.scheduling.quartz.CronTriggerBean">
  337. <property name="jobDetail" ref="AISLastSsxxTbSxl" />
  338. <property name="cronExpression" value="0 0/5 * * * ?" />
  339. </bean> -->
  340. <bean id="AISSsxxTbSxl" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  341. <property name="targetObject" ref="AISXxTbSxl" />
  342. <property name="targetMethod" value="AISssxxTb" />
  343. <property name="concurrent" value="false"/>
  344. </bean>
  345. <bean id="AISLastSsxxTbSxl" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  346. <property name="targetObject" ref="AISXxTbSxl" />
  347. <property name="targetMethod" value="AISLastSsxxTb" />
  348. <property name="concurrent" value="false"/>
  349. </bean>
  350. <bean id="AISXxTbSxl" class="com.jsjty.zygl.aisssxx.service.AISSsxxService" scope="prototype">
  351. </bean>
  352. <bean id = "_spDao"
  353. class = "com.jsjty.sp.dao.impl._SpDaoImpl">
  354. <property name = "jdbcTemplate" ref="jdbcTemplate"/>
  355. </bean>
  356. <bean id = "menuDao"
  357. class = "com.jsjty.menu.dao.MenuDao">
  358. <property name = "jdbcTemplate" ref="jdbcTemplate"/>
  359. </bean>
  360. </beans>