Browse code

BM-15295 Fix: it works when it's not an inner class...

Thomas Cataldo authored on 25/10/2019 13:14:32
Showing 3 changed files
... ...
@@ -221,7 +221,7 @@
221 221
    <extension
222 222
          point="net.bluemind.lib.vertx.verticles">
223 223
       <verticle
224
-            impl="net.bluemind.metrics.core.service.ProductChecksService$ConsumerFactory">
224
+            impl="net.bluemind.metrics.core.service.ChecksConsumerVerticle$ConsumerFactory">
225 225
       </verticle>
226 226
    </extension>
227 227
    
228 228
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+/* BEGIN LICENSE
2
+ * Copyright © Blue Mind SAS, 2012-2019
3
+ *
4
+ * This file is part of BlueMind. BlueMind is a messaging and collaborative
5
+ * solution.
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of either the GNU Affero General Public License as
9
+ * published by the Free Software Foundation (version 3 of the License).
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
+ *
15
+ * See LICENSE.txt
16
+ * END LICENSE
17
+ */
18
+package net.bluemind.metrics.core.service;
19
+
20
+import org.vertx.java.platform.Verticle;
21
+
22
+import net.bluemind.lib.vertx.IVerticleFactory;
23
+
24
+public class ChecksConsumerVerticle extends Verticle {
25
+	@Override
26
+	public void start() {
27
+		ProductChecksService.initConsumer();
28
+	}
29
+
30
+	public static class ConsumerFactory implements IVerticleFactory {
31
+
32
+		@Override
33
+		public boolean isWorker() {
34
+			return true;
35
+		}
36
+
37
+		@Override
38
+		public Verticle newInstance() {
39
+			return new ChecksConsumerVerticle();
40
+		}
41
+
42
+	}
43
+
44
+}
0 45
\ No newline at end of file
... ...
@@ -25,7 +25,6 @@ import java.util.concurrent.ConcurrentHashMap;
25 25
 import org.slf4j.Logger;
26 26
 import org.slf4j.LoggerFactory;
27 27
 import org.vertx.java.core.json.JsonObject;
28
-import org.vertx.java.platform.Verticle;
29 28
 
30 29
 import com.netflix.spectator.api.Registry;
31 30
 
... ...
@@ -36,7 +35,6 @@ import net.bluemind.core.task.api.TaskRef;
36 35
 import net.bluemind.core.task.service.ITasksManager;
37 36
 import net.bluemind.hornetq.client.MQ;
38 37
 import net.bluemind.hornetq.client.Topic;
39
-import net.bluemind.lib.vertx.IVerticleFactory;
40 38
 import net.bluemind.metrics.alerts.api.CheckResult;
41 39
 import net.bluemind.metrics.alerts.api.CheckResult.Level;
42 40
 import net.bluemind.metrics.alerts.api.IProductChecks;
... ...
@@ -48,29 +46,7 @@ public class ProductChecksService implements IProductChecks {
48 46
 
49 47
 	private static final Map<String, Optional<CheckResult>> results = new ConcurrentHashMap<>();
50 48
 
51
-	public static class ChecksConsumerVerticle extends Verticle {
52
-		@Override
53
-		public void start() {
54
-			initConsumer();
55
-		}
56
-
57
-	}
58
-
59
-	public static class ConsumerFactory implements IVerticleFactory {
60
-
61
-		@Override
62
-		public boolean isWorker() {
63
-			return true;
64
-		}
65
-
66
-		@Override
67
-		public Verticle newInstance() {
68
-			return new ChecksConsumerVerticle();
69
-		}
70
-
71
-	}
72
-
73
-	private static void initConsumer() {
49
+	static void initConsumer() {
74 50
 		MQ.init().whenComplete((v, ex) -> {
75 51
 
76 52
 			if (ex != null) {