Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
c86ff641
Commit
c86ff641
authored
Jun 11, 2020
by
郑航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改elasticjob注解 支持动态注入配置
parent
0b77110d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
ElasticJobAutoConfiguration.java
...c/job/lite/autoconfigure/ElasticJobAutoConfiguration.java
+2
-4
No files found.
elastic-job-lite-spring-boot-starter/src/main/java/cn/quantgroup/tech/elastic/job/lite/autoconfigure/ElasticJobAutoConfiguration.java
View file @
c86ff641
package
cn
.
quantgroup
.
tech
.
elastic
.
job
.
lite
.
autoconfigure
;
package
cn
.
quantgroup
.
tech
.
elastic
.
job
.
lite
.
autoconfigure
;
import
cn.quantgroup.tech.elastic.job.lite.annotation.ElasticSimpleJob
;
import
cn.quantgroup.tech.elastic.job.lite.annotation.ElasticSimpleJob
;
import
cn.quantgroup.tech.elastic.job.lite.listener.AddTraceListener
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
...
@@ -45,7 +44,6 @@ public class ElasticJobAutoConfiguration {
...
@@ -45,7 +44,6 @@ public class ElasticJobAutoConfiguration {
regCenter
.
init
();
regCenter
.
init
();
Map
<
String
,
SimpleJob
>
map
=
applicationContext
.
getBeansOfType
(
SimpleJob
.
class
);
Map
<
String
,
SimpleJob
>
map
=
applicationContext
.
getBeansOfType
(
SimpleJob
.
class
);
AddTraceListener
addTraceListener
=
new
AddTraceListener
();;
for
(
Map
.
Entry
<
String
,
SimpleJob
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
SimpleJob
>
entry
:
map
.
entrySet
())
{
SimpleJob
simpleJob
=
entry
.
getValue
();
SimpleJob
simpleJob
=
entry
.
getValue
();
ElasticSimpleJob
elasticSimpleJobAnnotation
=
AopUtils
.
getTargetClass
(
simpleJob
).
getAnnotation
(
ElasticSimpleJob
.
class
);
ElasticSimpleJob
elasticSimpleJobAnnotation
=
AopUtils
.
getTargetClass
(
simpleJob
).
getAnnotation
(
ElasticSimpleJob
.
class
);
...
@@ -62,10 +60,10 @@ public class ElasticJobAutoConfiguration {
...
@@ -62,10 +60,10 @@ public class ElasticJobAutoConfiguration {
DataSource
dataSource
=
(
DataSource
)
applicationContext
.
getBean
(
dataSourceRef
);
DataSource
dataSource
=
(
DataSource
)
applicationContext
.
getBean
(
dataSourceRef
);
JobEventRdbConfiguration
jobEventRdbConfiguration
=
new
JobEventRdbConfiguration
(
dataSource
);
JobEventRdbConfiguration
jobEventRdbConfiguration
=
new
JobEventRdbConfiguration
(
dataSource
);
SpringJobScheduler
jobScheduler
=
new
SpringJobScheduler
(
simpleJob
,
regCenter
,
liteJobConfiguration
,
jobEventRdbConfiguration
,
addTraceListener
);
SpringJobScheduler
jobScheduler
=
new
SpringJobScheduler
(
simpleJob
,
regCenter
,
liteJobConfiguration
,
jobEventRdbConfiguration
);
jobScheduler
.
init
();
jobScheduler
.
init
();
}
else
{
}
else
{
SpringJobScheduler
jobScheduler
=
new
SpringJobScheduler
(
simpleJob
,
regCenter
,
liteJobConfiguration
,
addTraceListener
);
SpringJobScheduler
jobScheduler
=
new
SpringJobScheduler
(
simpleJob
,
regCenter
,
liteJobConfiguration
);
jobScheduler
.
init
();
jobScheduler
.
init
();
}
}
}
}
...
...
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