applicationcontext-xxl-job.xml 2.5 KB
Newer Older
X
xueli.xue 已提交
1 2
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
X
xueli.xue 已提交
3 4 5
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
X
xueli.xue 已提交
6 7
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/context
X
xueli.xue 已提交
8
           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
X
xueli.xue 已提交
9

X
xueli.xue 已提交
10 11
	<!-- 配置01、JobHandler 扫描路径 -->
	<context:component-scan base-package="com.xxl.job.executor.service.jobhandler" />
X
xueli.xue 已提交
12

X
xueli.xue 已提交
13
	<!-- 配置02、执行器 -->
X
xueli.xue 已提交
14
	<bean id="xxlJobExecutor" class="com.xxl.job.core.executor.jetty.XxlJobExecutor" init-method="start" destroy-method="destroy" >
X
xueli.xue 已提交
15
		<!-- 执行器端口号 -->
X
xueli.xue 已提交
16 17
		<property name="port" value="9999" />
	</bean>
18

X
xueli.xue 已提交
19
	<!-- 配置03、GlueFactory (启用GLUE任务时才需要, 否则可删除) -->
X
xueli.xue 已提交
20
	<bean id="glueFactory" class="com.xxl.job.core.glue.GlueFactory">
X
xueli.xue 已提交
21
		<!-- GLUE任务示例缓存失效时间, 单位/ms -->
22
		<property name="cacheTimeout" value="10000" />
X
xueli.xue 已提交
23
		<!-- GLUE 代码加载器,推荐将该服务配置成RPC服务 -->
X
xueli.xue 已提交
24 25
		<property name="glueLoader" >
			<bean class="com.xxl.job.core.glue.loader.impl.DbGlueLoader" >
X
xueli.xue 已提交
26
				<!-- XXL-JOB公共数据源 -->
X
xueli.xue 已提交
27 28 29 30 31
				<property name="dataSource" ref="dataSource" />
			</bean>
		</property>
	</bean>

X
xueli.xue 已提交
32
	<!-- 配置04、XXL-JOB公共数据源 (启用GLUE任务, 且使用 "DbGlueLoader" 作为 "GLUE源码加载器" 时才需要, 否则可删除) -->
X
xueli.xue 已提交
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"  destroy-method="close">
		<property name="driverClass" value="${c3p0.driverClass}" />
		<property name="jdbcUrl" value="${c3p0.url}" />
		<property name="user" value="${c3p0.user}" />
		<property name="password" value="${c3p0.password}" />
		<property name="initialPoolSize" value="3" />
		<property name="minPoolSize" value="2" />
		<property name="maxPoolSize" value="10" />
		<property name="maxIdleTime" value="60" />
		<property name="acquireRetryDelay" value="1000" />
		<property name="acquireRetryAttempts" value="10" />
		<property name="preferredTestQuery" value="SELECT 1" />
	</bean>
	<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="fileEncoding" value="utf-8" />
		<property name="location">
			<value>classpath:jdbc.properties</value>
		</property>
X
xueli.xue 已提交
51
	</bean>
X
xueli.xue 已提交
52

X
xueli.xue 已提交
53
</beans>