chaokunyang commented on code in PR #2605:
URL: https://github.com/apache/fory/pull/2605#discussion_r2342834846


##########
java/fory-core/src/main/java/org/apache/fory/BaseFory.java:
##########
@@ -222,4 +223,7 @@ public interface BaseFory {
 
   /** Deep copy the <code>obj</code>. */
   <T> T copy(T obj);
+
+  /** Return the class resolver used by this fory instance. */
+  ClassResolver getClassResolver();

Review Comment:
   ThreadSafeFory is backed by a pool of fory instance. If you return a class 
resolver from ThreadSafeFory, it just return one of the class resolver to 
caller, and the registration only take effect on that Fory.
   
   You should add a `register(String)` method to `BaseFory`, and in that 
method, you call `registerCallback` to make the registration take effects for 
all fory instance:
   
   ```java
   public void register(String className) {
     registerCallback(f->f.getClassResolver().register(className));
   }
   ```



-- 
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