Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
a5757be4
提交
a5757be4
authored
3月 10, 2017
作者:
xueli.xue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean Code
上级
9e4f2c6b
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
78 行增加
和
81 行删除
+78
-81
README.md
README.md
+4
-3
IndexController.java
...in/java/com/xxl/job/admin/controller/IndexController.java
+2
-2
XxlJobDynamicScheduler.java
...m/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java
+1
-1
MailUtil.java
...n/src/main/java/com/xxl/job/admin/core/util/MailUtil.java
+19
-20
PropertiesUtil.java
...main/java/com/xxl/job/admin/core/util/PropertiesUtil.java
+5
-6
applicationcontext-xxl-job-admin.xml
...n/src/main/resources/applicationcontext-xxl-job-admin.xml
+25
-5
applicationcontext-xxl-job.xml
...b-admin/src/main/resources/applicationcontext-xxl-job.xml
+0
-27
config.properties
xxl-job-admin/src/main/resources/config.properties
+0
-12
jdbc.properties
xxl-job-admin/src/main/resources/jdbc.properties
+0
-5
xxl-job-admin.properties
xxl-job-admin/src/main/resources/xxl-job-admin.properties
+22
-0
没有找到文件。
README.md
浏览文件 @
a5757be4
...
...
@@ -88,11 +88,11 @@ XXL-JOB是一个轻量级分布式任务调度框架,其核心设计目标是

#### 1.5 环境
-
Servlet/JSP Spec:3.0/2.2
-
Jdk:1.7+
-
JDK:1.7+
-
Tomcat:7+
-
Mysql:5.6+
-
Servlet/JSP Spec:3.0/2.2
-
Maven:3+
-
Mysql:5.5+
## 二、快速入门
...
...
@@ -717,6 +717,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
3、执行器支持手动设置执行地址列表,提供开关切换使用注册地址还是手动设置的地址;
-
4、执行器路由规则:第一个、循环、随机、顺序故障(默认)转移;
-
5、CleanCode,清理无效的历史参数;
-
6、规范系统配置数据,通过配置文件统一管理;
#### TODO LIST
-
1、支持脚本JOB(源码或指定路径), 即shell/python/php等, 日志实时输出并支持在线监控;定制JobHandler实现;
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
浏览文件 @
a5757be4
...
...
@@ -45,8 +45,8 @@ public class IndexController {
public
ReturnT
<
String
>
loginDo
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
userName
,
String
password
,
String
ifRemember
){
if
(!
PermissionInterceptor
.
ifLogin
(
request
))
{
if
(
StringUtils
.
isNotBlank
(
userName
)
&&
StringUtils
.
isNotBlank
(
password
)
&&
PropertiesUtil
.
getString
(
"
login.username"
).
equals
(
userName
)
&&
PropertiesUtil
.
getString
(
"login.password"
).
equals
(
password
))
{
&&
PropertiesUtil
.
getString
(
"
xxl.job.login.username"
).
equals
(
userName
)
&&
PropertiesUtil
.
getString
(
"
xxl.job.
login.password"
).
equals
(
password
))
{
boolean
ifRem
=
false
;
if
(
StringUtils
.
isNotBlank
(
ifRemember
)
&&
"on"
.
equals
(
ifRemember
))
{
ifRem
=
true
;
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java
浏览文件 @
a5757be4
...
...
@@ -35,7 +35,7 @@ public final class XxlJobDynamicScheduler implements ApplicationContextAware, In
// Scheduler
private
static
Scheduler
scheduler
;
public
static
void
setScheduler
(
Scheduler
scheduler
)
{
public
void
setScheduler
(
Scheduler
scheduler
)
{
XxlJobDynamicScheduler
.
scheduler
=
scheduler
;
}
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/MailUtil.java
浏览文件 @
a5757be4
package
com
.
xxl
.
job
.
admin
.
core
.
util
;
import
java.io.File
;
import
java.util.Properties
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
javax.mail.internet.MimeMessage
;
import
javax.mail.internet.MimeUtility
;
import
org.apache.commons.lang.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -15,6 +7,13 @@ import org.springframework.mail.javamail.JavaMailSender;
import
org.springframework.mail.javamail.JavaMailSenderImpl
;
import
org.springframework.mail.javamail.MimeMessageHelper
;
import
javax.mail.internet.MimeMessage
;
import
javax.mail.internet.MimeUtility
;
import
java.io.File
;
import
java.util.Properties
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* 邮件发送.Util
* @author xuxueli 2016-3-12 15:06:20
...
...
@@ -29,12 +28,12 @@ public class MailUtil {
private
static
String
sendFrom
;
private
static
String
sendNick
;
static
{
host
=
PropertiesUtil
.
getString
(
"mail.host"
);
port
=
PropertiesUtil
.
getString
(
"mail.port"
);
username
=
PropertiesUtil
.
getString
(
"mail.username"
);
password
=
PropertiesUtil
.
getString
(
"mail.password"
);
sendFrom
=
PropertiesUtil
.
getString
(
"mail.sendFrom"
);
sendNick
=
PropertiesUtil
.
getString
(
"mail.sendNick"
);
host
=
PropertiesUtil
.
getString
(
"
xxl.job.
mail.host"
);
port
=
PropertiesUtil
.
getString
(
"
xxl.job.
mail.port"
);
username
=
PropertiesUtil
.
getString
(
"
xxl.job.
mail.username"
);
password
=
PropertiesUtil
.
getString
(
"
xxl.job.
mail.password"
);
sendFrom
=
PropertiesUtil
.
getString
(
"
xxl.job.
mail.sendFrom"
);
sendNick
=
PropertiesUtil
.
getString
(
"
xxl.job.
mail.sendNick"
);
}
/**
...
...
@@ -56,14 +55,14 @@ public class MailUtil {
/**
* 发送邮件 (完整版)(结合Spring)
*
* @param javaMailSender: 发送Bean
* @param sendFrom : 发送人邮箱
* @param sendNick : 发送人昵称
*
//
@param javaMailSender: 发送Bean
*
//
@param sendFrom : 发送人邮箱
*
//
@param sendNick : 发送人昵称
* @param toAddress : 收件人邮箱
* @param mailSubject : 邮件主题
* @param mailBody : 邮件正文
* @param mailBodyIsHtml: 邮件正文格式,true:HTML格式;false:文本格式
* @param
files[]
: 附件
* @param
attachments
: 附件
*/
@SuppressWarnings
(
"null"
)
public
static
boolean
sendMailSpring
(
String
toAddress
,
String
mailSubject
,
String
mailBody
,
boolean
mailBodyIsHtml
,
File
[]
attachments
)
{
...
...
@@ -106,8 +105,8 @@ public class MailUtil {
* @param mailSubject : 邮件主题
* @param mailBody : 邮件正文
* @param mailBodyIsHtml: 邮件正文格式,true:HTML格式;false:文本格式
* @param inLineFile : 内嵌文件
* @param
files[]
: 附件
*
//
@param inLineFile : 内嵌文件
* @param
attachments
: 附件
*/
public
static
boolean
sendMail
(
String
toAddress
,
String
mailSubject
,
String
mailBody
,
boolean
mailBodyIsHtml
,
File
[]
attachments
){
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/PropertiesUtil.java
浏览文件 @
a5757be4
package
com
.
xxl
.
job
.
admin
.
core
.
util
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.net.URL
;
import
java.util.Properties
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* properties util
* @author xuxueli 2015-8-28 10:35:53
*/
public
class
PropertiesUtil
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
PropertiesUtil
.
class
);
private
static
final
String
file_name
=
"
config
.properties"
;
private
static
final
String
file_name
=
"
xxl-job-admin
.properties"
;
/**
* load properties
* @param propertyFileName
* @param ifClassPath
* @return
*/
public
static
Properties
loadProperties
(
String
propertyFileName
)
{
...
...
@@ -55,7 +54,7 @@ public class PropertiesUtil {
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
getString
(
"
triggerLogUrl
"
));
System
.
out
.
println
(
getString
(
"
xxl.job.login.username
"
));
}
}
xxl-job-admin/src/main/resources/applicationcontext-
database
.xml
→
xxl-job-admin/src/main/resources/applicationcontext-
xxl-job-admin
.xml
浏览文件 @
a5757be4
...
...
@@ -14,17 +14,17 @@
<property
name=
"fileEncoding"
value=
"utf-8"
/>
<property
name=
"locations"
>
<list>
<value>
classpath*:
jdbc.properties
</value>
<value>
classpath*:
xxl-job-admin.properties
</value>
</list>
</property>
</bean>
<!-- part 1 :for datasource -->
<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=
"driverClass"
value=
"${
xxl.job.db.driverClass}"
/>
<property
name=
"jdbcUrl"
value=
"${
xxl.job.db.url}"
/>
<property
name=
"user"
value=
"${
xxl.job.db.user}"
/>
<property
name=
"password"
value=
"${
xxl.job.db.password}"
/>
<property
name=
"initialPoolSize"
value=
"3"
/>
<property
name=
"minPoolSize"
value=
"2"
/>
<property
name=
"maxPoolSize"
value=
"10"
/>
...
...
@@ -68,4 +68,23 @@
<aop:advisor
pointcut-ref=
"txoperation"
advice-ref=
"txAdvice"
/>
</aop:config>
<!-- part 3 :for quartz -->
<bean
id=
"quartzScheduler"
lazy-init=
"false"
class=
"org.springframework.scheduling.quartz.SchedulerFactoryBean"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<property
name=
"autoStartup"
value=
"true"
/>
<!--自动启动 -->
<property
name=
"startupDelay"
value=
"20"
/>
<!--延时启动 -->
<property
name=
"applicationContextSchedulerContextKey"
value=
"applicationContextKey"
/>
<property
name=
"configLocation"
value=
"classpath:quartz.properties"
/>
</bean>
<!-- 协同-调度器 -->
<bean
id=
"xxlJobDynamicScheduler"
class=
"com.xxl.job.admin.core.schedule.XxlJobDynamicScheduler"
init-method=
"init"
destroy-method=
"destroy"
>
<!-- (轻易不要变更“调度器名称”, 任务创建时会绑定该“调度器名称”) -->
<property
name=
"scheduler"
ref=
"quartzScheduler"
/>
<!-- 调度中心回调IP[选填],为空则自动获取 -->
<property
name=
"callBackIp"
value=
"${xxl.job.callBackIp}"
/>
<!-- 调度中心回调端口号 -->
<property
name=
"callBackPort"
value=
"${xxl.job.callBackPort}"
/>
</bean>
</beans>
\ No newline at end of file
xxl-job-admin/src/main/resources/applicationcontext-xxl-job.xml
deleted
100644 → 0
浏览文件 @
9e4f2c6b
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
>
<!-- quartz-调度器 -->
<bean
id=
"quartzScheduler"
lazy-init=
"false"
class=
"org.springframework.scheduling.quartz.SchedulerFactoryBean"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<property
name=
"autoStartup"
value=
"true"
/>
<!--自动启动 -->
<property
name=
"startupDelay"
value=
"20"
/>
<!--延时启动 -->
<property
name=
"applicationContextSchedulerContextKey"
value=
"applicationContextKey"
/>
<property
name=
"configLocation"
value=
"classpath:quartz.properties"
/>
</bean>
<!-- 协同-调度器 -->
<bean
id=
"dynamicSchedulerUtil"
class=
"com.xxl.job.admin.core.schedule.XxlJobDynamicScheduler"
init-method=
"init"
destroy-method=
"destroy"
>
<!-- (轻易不要变更“调度器名称”, 任务创建时会绑定该“调度器名称”) -->
<property
name=
"scheduler"
ref=
"quartzScheduler"
/>
<!-- 调度中心回调IP[选填],为空则自动获取 -->
<!--<property name="callBackIp" value=""/>-->
<!-- 调度中心回调端口号 -->
<property
name=
"callBackPort"
value=
"8888"
/>
</bean>
</beans>
\ No newline at end of file
xxl-job-admin/src/main/resources/config.properties
deleted
100644 → 0
浏览文件 @
9e4f2c6b
# for email
mail.host
=
smtp.163.com
mail.port
=
25
mail.username
=
ovono802302@163.com
mail.password
=
asdfzxcv
mail.sendFrom
=
ovono802302@163.com
mail.sendNick
=
《任务调度平台XXL-JOB》
# for login
login.username
=
admin
login.password
=
123456
\ No newline at end of file
xxl-job-admin/src/main/resources/jdbc.properties
deleted
100644 → 0
浏览文件 @
9e4f2c6b
c3p0.driverClass
=
com.mysql.jdbc.Driver
c3p0.url
=
jdbc:mysql://localhost:3306/xxl-job?useUnicode=true&characterEncoding=UTF-8
c3p0.user
=
root
c3p0.password
=
root_pwd
\ No newline at end of file
xxl-job-admin/src/main/resources/xxl-job-admin.properties
0 → 100644
浏览文件 @
a5757be4
### xxl-job db
xxl.job.db.driverClass
=
com.mysql.jdbc.Driver
xxl.job.db.url
=
jdbc:mysql://localhost:3306/xxl-job?useUnicode=true&characterEncoding=UTF-8
xxl.job.db.user
=
root
xxl.job.db.password
=
root_pwd
### xxl-job callback address
xxl.job.callBackIp
=
xxl.job.callBackPort
=
8888
### xxl-job email
xxl.job.mail.host
=
smtp.163.com
xxl.job.mail.port
=
25
xxl.job.mail.username
=
ovono802302@163.com
xxl.job.mail.password
=
asdfzxcv
xxl.job.mail.sendFrom
=
ovono802302@163.com
xxl.job.mail.sendNick
=
《任务调度平台XXL-JOB》
# xxl-job login
xxl.job.login.username
=
admin
xxl.job.login.password
=
123456
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论