yuluo-yx commented on code in PR #4030:
URL: https://github.com/apache/hertzbeat/pull/4030#discussion_r2868921799


##########
hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/nativex/HertzbeatRuntimeHintsRegistrar.java:
##########
@@ -61,6 +77,44 @@ public void registerHints(@NonNull RuntimeHints hints, 
ClassLoader classLoader)
         }
     }
 
+    private void registerResourceHints(RuntimeHints hints) {
+        hints.resources().registerPattern("application*.yml");
+        hints.resources().registerPattern("banner.txt");
+        hints.resources().registerPattern("sureness.yml");
+        hints.resources().registerPattern("logback-spring.xml");
+        hints.resources().registerPattern("db/migration/**");
+        hints.resources().registerPattern("define/*.yml");
+        hints.resources().registerPattern("define/*.yaml");
+        hints.resources().registerPattern("templates/**");
+        hints.resources().registerPattern("grafana/*.json");
+        hints.resources().registerPattern("dist/**");
+        
hints.resources().registerPattern("META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports");
+    }
+
+    private void registerYamlModelHints(RuntimeHints hints) {
+        registerTypeWithDeclaredMembers(hints, Job.class);
+        registerTypeWithDeclaredMembers(hints, Metrics.class);
+        registerTypeWithDeclaredMembers(hints, Metrics.Field.class);
+        registerTypeWithDeclaredMembers(hints, Configmap.class);
+        registerTypeWithDeclaredMembers(hints, ParamDefine.class);
+        registerTypeWithDeclaredMembers(hints, ParamDefine.Option.class);
+        registerTypeWithDeclaredMembers(hints, PluginConfig.class);
+
+        Arrays.stream(Metrics.class.getDeclaredFields())
+                .map(Field::getType)
+                .filter(this::isJobProtocolClass)
+                .forEach(type -> registerTypeWithDeclaredMembers(hints, type));
+    }
+
+    private boolean isJobProtocolClass(Class<?> type) {
+        return type.getName().startsWith(JobProtocolPackageNamePrefix);
+    }
+
+    private void registerTypeWithDeclaredMembers(RuntimeHints hints, Class<?> 
clazz) {
+        hints.reflection().registerType(clazz, hint -> 
hint.withMembers(YAML_MODEL_MEMBER_CATEGORIES));
+        registerConstructor(hints, clazz);

Review Comment:
   这里在注册一次是不是有点多余了?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to