Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
74c735bc
authored
Dec 12, 2019
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update document
parent
c042cb15
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
30 deletions
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/config/NutzSetup.java
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/CommandJobHandler.java
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/DemoJobHandler.java
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/HttpJobHandler.java
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/ShardingJobHandler.java
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/config/NutzSetup.java
View file @
74c735bc
package
com
.
xuxueli
.
executor
.
sample
.
nutz
.
config
;
package
com
.
xuxueli
.
executor
.
sample
.
nutz
.
config
;
import
com.xuxueli.executor.sample.nutz.jobhandler.CommandJobHandler
;
import
com.xuxueli.executor.sample.nutz.jobhandler.DemoJobHandler
;
import
com.xuxueli.executor.sample.nutz.jobhandler.HttpJobHandler
;
import
com.xuxueli.executor.sample.nutz.jobhandler.ShardingJobHandler
;
import
com.xxl.job.core.executor.XxlJobExecutor
;
import
com.xxl.job.core.executor.XxlJobExecutor
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
org.nutz.ioc.impl.PropertiesProxy
;
import
org.nutz.ioc.impl.PropertiesProxy
;
import
org.nutz.mvc.NutConfig
;
import
org.nutz.mvc.NutConfig
;
import
org.nutz.mvc.Setup
;
import
org.nutz.mvc.Setup
;
...
@@ -16,23 +18,17 @@ import org.slf4j.LoggerFactory;
...
@@ -16,23 +18,17 @@ import org.slf4j.LoggerFactory;
*/
*/
public
class
NutzSetup
implements
Setup
{
public
class
NutzSetup
implements
Setup
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
NutzSetup
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
NutzSetup
.
class
);
//public static final Log logger = Logs.get();
private
XxlJobExecutor
xxlJobExecutor
=
null
;
private
XxlJobExecutor
xxlJobExecutor
=
null
;
@Override
@Override
public
void
init
(
NutConfig
cfg
)
{
public
void
init
(
NutConfig
cfg
)
{
// regist JobHandler
// registry jobhandler
String
[]
beanNames
=
cfg
.
getIoc
().
getNamesByType
(
IJobHandler
.
class
);
XxlJobExecutor
.
registJobHandler
(
"demoJobHandler"
,
new
DemoJobHandler
());
if
(
beanNames
==
null
||
beanNames
.
length
==
0
)
{
XxlJobExecutor
.
registJobHandler
(
"shardingJobHandler"
,
new
ShardingJobHandler
());
return
;
XxlJobExecutor
.
registJobHandler
(
"httpJobHandler"
,
new
HttpJobHandler
());
}
XxlJobExecutor
.
registJobHandler
(
"commandJobHandler"
,
new
CommandJobHandler
());
for
(
String
beanName
:
beanNames
)
{
IJobHandler
jobHandler
=
cfg
.
getIoc
().
get
(
IJobHandler
.
class
,
beanName
);
String
name
=
jobHandler
.
getClass
().
getAnnotation
(
JobHandler
.
class
).
value
();
XxlJobExecutor
.
registJobHandler
(
name
,
jobHandler
);
}
// load executor prop
// load executor prop
PropertiesProxy
xxlJobProp
=
new
PropertiesProxy
(
"xxl-job-executor.properties"
);
PropertiesProxy
xxlJobProp
=
new
PropertiesProxy
(
"xxl-job-executor.properties"
);
...
...
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/CommandJobHandler.java
View file @
74c735bc
...
@@ -2,9 +2,7 @@ package com.xuxueli.executor.sample.nutz.jobhandler;
...
@@ -2,9 +2,7 @@ package com.xuxueli.executor.sample.nutz.jobhandler;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
org.nutz.ioc.loader.annotation.IocBean
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
...
@@ -15,8 +13,6 @@ import java.io.InputStreamReader;
...
@@ -15,8 +13,6 @@ import java.io.InputStreamReader;
*
*
* @author xuxueli 2018-09-16 03:48:34
* @author xuxueli 2018-09-16 03:48:34
*/
*/
@JobHandler
(
value
=
"commandJobHandler"
)
@IocBean
public
class
CommandJobHandler
extends
IJobHandler
{
public
class
CommandJobHandler
extends
IJobHandler
{
@Override
@Override
...
...
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/DemoJobHandler.java
View file @
74c735bc
...
@@ -2,9 +2,7 @@ package com.xuxueli.executor.sample.nutz.jobhandler;
...
@@ -2,9 +2,7 @@ package com.xuxueli.executor.sample.nutz.jobhandler;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
org.nutz.ioc.loader.annotation.IocBean
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -19,8 +17,6 @@ import java.util.concurrent.TimeUnit;
...
@@ -19,8 +17,6 @@ import java.util.concurrent.TimeUnit;
*
*
* @author xuxueli 2015-12-19 19:43:36
* @author xuxueli 2015-12-19 19:43:36
*/
*/
@JobHandler
(
value
=
"demoJobHandler"
)
@IocBean
public
class
DemoJobHandler
extends
IJobHandler
{
public
class
DemoJobHandler
extends
IJobHandler
{
@Override
@Override
...
...
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/HttpJobHandler.java
View file @
74c735bc
...
@@ -2,9 +2,7 @@ package com.xuxueli.executor.sample.nutz.jobhandler;
...
@@ -2,9 +2,7 @@ package com.xuxueli.executor.sample.nutz.jobhandler;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
org.nutz.ioc.loader.annotation.IocBean
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
...
@@ -16,8 +14,6 @@ import java.net.URL;
...
@@ -16,8 +14,6 @@ import java.net.URL;
*
*
* @author xuxueli 2018-09-16 03:48:34
* @author xuxueli 2018-09-16 03:48:34
*/
*/
@JobHandler
(
value
=
"httpJobHandler"
)
@IocBean
public
class
HttpJobHandler
extends
IJobHandler
{
public
class
HttpJobHandler
extends
IJobHandler
{
@Override
@Override
...
...
xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/ShardingJobHandler.java
View file @
74c735bc
package
com
.
xuxueli
.
executor
.
sample
.
nutz
.
jobhandler
;
package
com
.
xuxueli
.
executor
.
sample
.
nutz
.
jobhandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
org.nutz.ioc.loader.annotation.IocBean
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
com.xxl.job.core.log.XxlJobLogger
;
...
@@ -13,8 +10,6 @@ import com.xxl.job.core.util.ShardingUtil;
...
@@ -13,8 +10,6 @@ import com.xxl.job.core.util.ShardingUtil;
*
*
* @author xuxueli 2017-07-25 20:56:50
* @author xuxueli 2017-07-25 20:56:50
*/
*/
@JobHandler
(
value
=
"shardingJobHandler"
)
@IocBean
public
class
ShardingJobHandler
extends
IJobHandler
{
public
class
ShardingJobHandler
extends
IJobHandler
{
@Override
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment