Procházet zdrojové kódy

Create XxlJobAdminBean

jzl před 5 roky
rodič
revize
80333db80e
No account linked to committer's email

+ 27 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminBean Zobrazit soubor

@@ -0,0 +1,27 @@
1
+package com.xxl.job.admin.conf;
2
+
3
+import org.springframework.beans.factory.annotation.Qualifier;
4
+import org.springframework.context.annotation.Bean;
5
+import org.springframework.context.annotation.Configuration;
6
+
7
+/**
8
+ * @Auther: zhuolin.ji
9
+ * @Date: 2019/10/12 18:08
10
+ * @Package: com.xxl.job.admin.conf
11
+ * @Description:
12
+ */
13
+@Configuration
14
+public class XxlJobAdminBean {
15
+
16
+    @Bean(name = "xxlJobAdminConfig")
17
+    public XxlJobAdminConfig getXxlJobAdminConfig() {
18
+        return new XxlJobAdminConfig();
19
+    }
20
+
21
+    @Bean(initMethod = "init", destroyMethod = "destroy")
22
+    public XxlJobScheduler getXxlJobScheduler(@Qualifier(value = "xxlJobAdminConfig") XxlJobAdminConfig xxlJobAdminConfig) {
23
+        XxlJobAdminConfig.setAdminConfig(xxlJobAdminConfig);
24
+        return new XxlJobScheduler();
25
+    }
26
+
27
+}