Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
7584097e
Commit
7584097e
authored
Apr 14, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加java_task对照类
parent
e0f4b7a1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
3 deletions
+110
-3
JavaTask.java
...-dto-core/src/main/java/com/byit/dto/plugin/JavaTask.java
+66
-0
TaskHandler.java
.../src/main/java/com/byit/task/annotations/TaskHandler.java
+26
-1
DefaultRemainingOperationsCallBack.java
...com/byit/callback/DefaultRemainingOperationsCallBack.java
+17
-1
PluginServerFactory.java
...r/src/main/java/com/byit/factory/PluginServerFactory.java
+1
-1
No files found.
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/plugin/JavaTask.java
0 → 100644
View file @
7584097e
package
com
.
byit
.
dto
.
plugin
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* java执行节点
* @author huangfu
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
JavaTask
{
/**
* 主键
*/
private
Integer
id
;
/**
* 任务名称
*/
private
String
jobName
;
/**
* 调度名称
*/
private
String
taskName
;
/**
* 调度次数 默认周期性调度
*/
private
String
schedulingCount
;
/**
* 调度参数
*/
private
String
param
;
/**
* 本次的执行时间
*/
private
Long
triggerTime
;
/**
* cron表达式
*/
private
String
cron
;
/**
* 剩余执行词素
*/
private
Integer
remainingCount
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 修改时间
*/
private
Date
updateTime
;
/**
* 告警时机
*/
private
String
alarmlAction
;
/**
* 邮件接收人
*/
private
String
sendEmail
;
}
byit-plugin-core/byit-plugin-rpc-common/src/main/java/com/byit/task/annotations/TaskHandler.java
View file @
7584097e
...
@@ -17,14 +17,39 @@ public @interface TaskHandler {
...
@@ -17,14 +17,39 @@ public @interface TaskHandler {
String
cron
()
default
""
;
String
cron
()
default
""
;
/**
/**
*
任务名称
*
调度名称 这个名称是任务体的key 需要保持唯一性
* @return 任务名称
* @return 任务名称
*/
*/
String
taskName
();
String
taskName
();
/**
/**
* 这个是任务名称 调度中心的唯一key值 需要保证唯一性 默认与 taskName 保持一致
* 任务名称
*/
String
jobName
()
default
""
;
/**
* 是否自动发布
* 是否自动发布
* @return 是否自动发布
* @return 是否自动发布
*/
*/
boolean
autoPublish
()
default
false
;
boolean
autoPublish
()
default
false
;
/**
* 自动发布的地址
* @return
*/
String
publishUrl
()
default
""
;
/**
* 调度次数 默认为-1 周期不间断调度
* @return
*/
int
schedulingCount
()
default
-
1
;
/**
* 当前工作流版本的告警的时机(0 不告警, 1 完成时告警, 2 失败时告警, 3 成功时告警)
*/
String
alarmlAction
()
default
"1"
;
String
sendEmail
()
default
""
;
}
}
byit-plugin-core/myth-plugin-rpc-server/src/main/java/com/byit/callback/DefaultRemainingOperationsCallBack.java
View file @
7584097e
package
com
.
byit
.
callback
;
package
com
.
byit
.
callback
;
import
com.byit.task.annotations.TaskHandler
;
import
com.byit.task.handler.interfaces.IJobHandler
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -9,6 +12,19 @@ import java.util.Map;
...
@@ -9,6 +12,19 @@ import java.util.Map;
public
class
DefaultRemainingOperationsCallBack
implements
RemainingOperationsCallBack
{
public
class
DefaultRemainingOperationsCallBack
implements
RemainingOperationsCallBack
{
@Override
@Override
public
void
serverRemainingOperations
(
Map
<
String
,
Object
>
map
)
{
public
void
serverRemainingOperations
(
Map
<
String
,
Object
>
map
)
{
System
.
out
.
println
(
map
);
//注册方法数据
new
Thread
(()
->{
map
.
forEach
((
key
,
value
)
->{
Class
<?>
nodeClass
=
value
.
getClass
();
if
(
nodeClass
.
isAnnotationPresent
(
TaskHandler
.
class
))
{
TaskHandler
annotation
=
nodeClass
.
getAnnotation
(
TaskHandler
.
class
);
//如果是自动注册 就实现自动注册
if
(
annotation
.
autoPublish
())
{
}
}
}
});
});
}
}
}
byit-plugin-core/myth-plugin-rpc-server/src/main/java/com/byit/factory/PluginServerFactory.java
View file @
7584097e
...
@@ -153,7 +153,7 @@ public abstract class PluginServerFactory {
...
@@ -153,7 +153,7 @@ public abstract class PluginServerFactory {
pluginServiceRegistry
.
stop
();
pluginServiceRegistry
.
stop
();
pluginServiceRegistry
=
null
;
pluginServiceRegistry
=
null
;
});
});
//调用
剩余方法的回调
//调用
自定义实现
remainingOperationsCallBackObj
.
serverRemainingOperations
(
serverPoll
);
remainingOperationsCallBackObj
.
serverRemainingOperations
(
serverPoll
);
//启动服务器
//启动服务器
pluginServer
.
start
(
this
);
pluginServer
.
start
(
this
);
...
...
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