Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
tool
/
xxl-job
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 50b1c679
authored
Aug 18, 2018
by
xuxueli
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
RM
1 parent
7a0f63f7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
234 additions
and
234 deletions
xxl-job-admin/src/main/java/com/xxl/job/admin/core/jobbean/RemoteHttpJobBean.java
xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobLog.java
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
xxl-job-core/src/main/java/com/xxl/job/core/handler/IJobHandler.java
xxl-job-admin/src/main/java/com/xxl/job/admin/core/jobbean/RemoteHttpJobBean.java
View file @
50b1c67
package
com
.
xxl
.
job
.
admin
.
core
.
jobbean
;
import
com.xxl.job.admin.core.thread.JobTriggerPoolHelper
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.quartz.JobKey
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
/**
* http job bean
* “@DisallowConcurrentExecution” diable concurrent, thread size can not be only one, better given more
* @author xuxueli 2015-12-17 18:20:34
*/
//@DisallowConcurrentExecution
public
class
RemoteHttpJobBean
extends
QuartzJobBean
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
RemoteHttpJobBean
.
class
);
@Override
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
// load jobId
JobKey
jobKey
=
context
.
getTrigger
().
getJobKey
();
Integer
jobId
=
Integer
.
valueOf
(
jobKey
.
getName
());
// trigger
//XxlJobTrigger.trigger(jobId);
JobTriggerPoolHelper
.
trigger
(
jobId
,
-
1
);
}
package
com
.
xxl
.
job
.
admin
.
core
.
jobbean
;
import
com.xxl.job.admin.core.thread.JobTriggerPoolHelper
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
org.quartz.JobKey
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.scheduling.quartz.QuartzJobBean
;
/**
* http job bean
* “@DisallowConcurrentExecution” diable concurrent, thread size can not be only one, better given more
* @author xuxueli 2015-12-17 18:20:34
*/
//@DisallowConcurrentExecution
public
class
RemoteHttpJobBean
extends
QuartzJobBean
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
RemoteHttpJobBean
.
class
);
@Override
protected
void
executeInternal
(
JobExecutionContext
context
)
throws
JobExecutionException
{
// load jobId
JobKey
jobKey
=
context
.
getTrigger
().
getJobKey
();
Integer
jobId
=
Integer
.
valueOf
(
jobKey
.
getName
());
// trigger
//XxlJobTrigger.trigger(jobId);
JobTriggerPoolHelper
.
trigger
(
jobId
,
-
1
);
}
}
\ No newline at end of file
xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobLog.java
View file @
50b1c67
package
com
.
xxl
.
job
.
admin
.
core
.
model
;
import
java.util.Date
;
/**
* xxl-job log, used to track trigger process
* @author xuxueli 2015-12-19 23:19:09
*/
public
class
XxlJobLog
{
private
int
id
;
// job info
private
int
jobGroup
;
private
int
jobId
;
// glueType
private
String
glueType
;
// execute info
private
String
executorAddress
;
private
String
executorHandler
;
private
String
executorParam
;
private
int
executorFailRetryCount
;
// trigger info
private
Date
triggerTime
;
private
int
triggerCode
;
private
String
triggerMsg
;
// handle info
private
Date
handleTime
;
private
int
handleCode
;
private
String
handleMsg
;
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
int
getJobGroup
()
{
return
jobGroup
;
}
public
void
setJobGroup
(
int
jobGroup
)
{
this
.
jobGroup
=
jobGroup
;
}
public
int
getJobId
()
{
return
jobId
;
}
public
void
setJobId
(
int
jobId
)
{
this
.
jobId
=
jobId
;
}
public
String
getGlueType
()
{
return
glueType
;
}
public
void
setGlueType
(
String
glueType
)
{
this
.
glueType
=
glueType
;
}
public
String
getExecutorAddress
()
{
return
executorAddress
;
}
public
void
setExecutorAddress
(
String
executorAddress
)
{
this
.
executorAddress
=
executorAddress
;
}
public
String
getExecutorHandler
()
{
return
executorHandler
;
}
public
void
setExecutorHandler
(
String
executorHandler
)
{
this
.
executorHandler
=
executorHandler
;
}
public
String
getExecutorParam
()
{
return
executorParam
;
}
public
void
setExecutorParam
(
String
executorParam
)
{
this
.
executorParam
=
executorParam
;
}
public
int
getExecutorFailRetryCount
()
{
return
executorFailRetryCount
;
}
public
void
setExecutorFailRetryCount
(
int
executorFailRetryCount
)
{
this
.
executorFailRetryCount
=
executorFailRetryCount
;
}
public
Date
getTriggerTime
()
{
return
triggerTime
;
}
public
void
setTriggerTime
(
Date
triggerTime
)
{
this
.
triggerTime
=
triggerTime
;
}
public
int
getTriggerCode
()
{
return
triggerCode
;
}
public
void
setTriggerCode
(
int
triggerCode
)
{
this
.
triggerCode
=
triggerCode
;
}
public
String
getTriggerMsg
()
{
return
triggerMsg
;
}
public
void
setTriggerMsg
(
String
triggerMsg
)
{
// plugin
if
(
triggerMsg
!=
null
&&
triggerMsg
.
length
()>
2000
)
{
triggerMsg
=
triggerMsg
.
substring
(
0
,
2000
);
}
this
.
triggerMsg
=
triggerMsg
;
}
public
Date
getHandleTime
()
{
return
handleTime
;
}
public
void
setHandleTime
(
Date
handleTime
)
{
this
.
handleTime
=
handleTime
;
}
public
int
getHandleCode
()
{
return
handleCode
;
}
public
void
setHandleCode
(
int
handleCode
)
{
this
.
handleCode
=
handleCode
;
}
public
String
getHandleMsg
()
{
return
handleMsg
;
}
public
void
setHandleMsg
(
String
handleMsg
)
{
// plugin
if
(
handleMsg
!=
null
&&
handleMsg
.
length
()>
2000
)
{
handleMsg
=
handleMsg
.
substring
(
0
,
2000
);
}
this
.
handleMsg
=
handleMsg
;
}
}
package
com
.
xxl
.
job
.
admin
.
core
.
model
;
import
java.util.Date
;
/**
* xxl-job log, used to track trigger process
* @author xuxueli 2015-12-19 23:19:09
*/
public
class
XxlJobLog
{
private
int
id
;
// job info
private
int
jobGroup
;
private
int
jobId
;
// glueType
private
String
glueType
;
// execute info
private
String
executorAddress
;
private
String
executorHandler
;
private
String
executorParam
;
private
int
executorFailRetryCount
;
// trigger info
private
Date
triggerTime
;
private
int
triggerCode
;
private
String
triggerMsg
;
// handle info
private
Date
handleTime
;
private
int
handleCode
;
private
String
handleMsg
;
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
int
getJobGroup
()
{
return
jobGroup
;
}
public
void
setJobGroup
(
int
jobGroup
)
{
this
.
jobGroup
=
jobGroup
;
}
public
int
getJobId
()
{
return
jobId
;
}
public
void
setJobId
(
int
jobId
)
{
this
.
jobId
=
jobId
;
}
public
String
getGlueType
()
{
return
glueType
;
}
public
void
setGlueType
(
String
glueType
)
{
this
.
glueType
=
glueType
;
}
public
String
getExecutorAddress
()
{
return
executorAddress
;
}
public
void
setExecutorAddress
(
String
executorAddress
)
{
this
.
executorAddress
=
executorAddress
;
}
public
String
getExecutorHandler
()
{
return
executorHandler
;
}
public
void
setExecutorHandler
(
String
executorHandler
)
{
this
.
executorHandler
=
executorHandler
;
}
public
String
getExecutorParam
()
{
return
executorParam
;
}
public
void
setExecutorParam
(
String
executorParam
)
{
this
.
executorParam
=
executorParam
;
}
public
int
getExecutorFailRetryCount
()
{
return
executorFailRetryCount
;
}
public
void
setExecutorFailRetryCount
(
int
executorFailRetryCount
)
{
this
.
executorFailRetryCount
=
executorFailRetryCount
;
}
public
Date
getTriggerTime
()
{
return
triggerTime
;
}
public
void
setTriggerTime
(
Date
triggerTime
)
{
this
.
triggerTime
=
triggerTime
;
}
public
int
getTriggerCode
()
{
return
triggerCode
;
}
public
void
setTriggerCode
(
int
triggerCode
)
{
this
.
triggerCode
=
triggerCode
;
}
public
String
getTriggerMsg
()
{
return
triggerMsg
;
}
public
void
setTriggerMsg
(
String
triggerMsg
)
{
// plugin
if
(
triggerMsg
!=
null
&&
triggerMsg
.
length
()>
2000
)
{
triggerMsg
=
triggerMsg
.
substring
(
0
,
2000
);
}
this
.
triggerMsg
=
triggerMsg
;
}
public
Date
getHandleTime
()
{
return
handleTime
;
}
public
void
setHandleTime
(
Date
handleTime
)
{
this
.
handleTime
=
handleTime
;
}
public
int
getHandleCode
()
{
return
handleCode
;
}
public
void
setHandleCode
(
int
handleCode
)
{
this
.
handleCode
=
handleCode
;
}
public
String
getHandleMsg
()
{
return
handleMsg
;
}
public
void
setHandleMsg
(
String
handleMsg
)
{
// plugin
if
(
handleMsg
!=
null
&&
handleMsg
.
length
()>
2000
)
{
handleMsg
=
handleMsg
.
substring
(
0
,
2000
);
}
this
.
handleMsg
=
handleMsg
;
}
}
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml
View file @
50b1c67
This diff is collapsed.
Click to expand it.
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
View file @
50b1c67
This diff is collapsed.
Click to expand it.
xxl-job-core/src/main/java/com/xxl/job/core/handler/IJobHandler.java
View file @
50b1c67
package
com
.
xxl
.
job
.
core
.
handler
;
import
com.xxl.job.core.biz.model.ReturnT
;
/**
* job handler
*
* @author xuxueli 2015-12-19 19:06:38
*/
public
abstract
class
IJobHandler
{
/** success */
public
static
final
ReturnT
<
String
>
SUCCESS
=
new
ReturnT
<
String
>(
200
,
null
);
/** fail */
public
static
final
ReturnT
<
String
>
FAIL
=
new
ReturnT
<
String
>(
500
,
null
);
/** fail timeout */
public
static
final
ReturnT
<
String
>
FAIL_TIMEOUT
=
new
ReturnT
<
String
>(
502
,
null
);
/**
* execute handler, invoked when executor receives a scheduling request
*
* @param param
* @return
* @throws Exception
*/
public
abstract
ReturnT
<
String
>
execute
(
String
param
)
throws
Exception
;
/**
* init handler, invoked when JobThread init
*/
public
void
init
()
{
// TODO
}
/**
* destroy handler, invoked when JobThread destroy
*/
public
void
destroy
()
{
// TODO
}
}
package
com
.
xxl
.
job
.
core
.
handler
;
import
com.xxl.job.core.biz.model.ReturnT
;
/**
* job handler
*
* @author xuxueli 2015-12-19 19:06:38
*/
public
abstract
class
IJobHandler
{
/** success */
public
static
final
ReturnT
<
String
>
SUCCESS
=
new
ReturnT
<
String
>(
200
,
null
);
/** fail */
public
static
final
ReturnT
<
String
>
FAIL
=
new
ReturnT
<
String
>(
500
,
null
);
/** fail timeout */
public
static
final
ReturnT
<
String
>
FAIL_TIMEOUT
=
new
ReturnT
<
String
>(
502
,
null
);
/**
* execute handler, invoked when executor receives a scheduling request
*
* @param param
* @return
* @throws Exception
*/
public
abstract
ReturnT
<
String
>
execute
(
String
param
)
throws
Exception
;
/**
* init handler, invoked when JobThread init
*/
public
void
init
()
{
// TODO
}
/**
* destroy handler, invoked when JobThread destroy
*/
public
void
destroy
()
{
// TODO
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment