chaokunyang commented on code in PR #2701:
URL: https://github.com/apache/fory/pull/2701#discussion_r2447071608
##########
java/fory-core/src/main/java/org/apache/fory/resolver/TypeResolver.java:
##########
@@ -670,6 +674,82 @@ public final MetaStringResolver getMetaStringResolver() {
return metaStringResolver;
}
+ /**
+ * Get all registered classes across all GraalVM registries for native image
compilation.
+ *
+ * @return unmodifiable set of all registered classes
+ */
+ public static Set<Class<?>> getAllRegisteredClasses() {
Review Comment:
How about movign those methods into GraalvmSupport.java, and we can register
all needs info into GraalvmSupport in `TypeResolver#enableSerialziersCcmpiled`.
In thsi wya, the API is more clean
##########
java/fory-core/src/main/java/org/apache/fory/resolver/TypeResolver.java:
##########
@@ -670,6 +674,82 @@ public final MetaStringResolver getMetaStringResolver() {
return metaStringResolver;
}
+ /**
+ * Get all registered classes across all GraalVM registries for native image
compilation.
+ *
+ * @return unmodifiable set of all registered classes
+ */
+ public static Set<Class<?>> getAllRegisteredClasses() {
+ Set<Class<?>> allClasses = ConcurrentHashMap.newKeySet();
+ for (GraalvmClassRegistry registry : GRAALVM_REGISTRY.values()) {
+ allClasses.addAll(registry.registeredClasses);
+ }
+ return Collections.unmodifiableSet(allClasses);
+ }
+
+ /**
+ * Get all registered proxy interfaces across all GraalVM registries for
native image compilation.
+ *
+ * @return unmodifiable set of all registered proxy interfaces
+ */
+ public static Set<Class<?>> getAllProxyInterfaces() {
Review Comment:
ditto
--
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]