GitHub user tex1988 added a comment to the discussion: Get Java Class<?> type
object before deserialization of payload
I still can't understand how to get Fory from ThreadSafeFory. Here is my code
that build Fory
```
ForyBuilder builder = Fory.builder()
.withLanguage(Language.JAVA)
.withRefTracking(true)
.withAsyncCompilation(true);
boolean isRegistrationRequired = allowedListClasses != null &&
!allowedListClasses.isEmpty();
builder.requireClassRegistration(isRegistrationRequired);
ThreadSafeFory fory = builder.buildThreadSafeForyPool(minPoolSize,
maxPoolSize);
if (isRegistrationRequired) {
for (Class<?> clazz : allowedListClasses) {
fory.register(clazz);
}
}
```
buildThreadSafeForyPool returns a ThreadSafeFory, which extends BaseFory.
Neither of these types has a public getClassResolver() method.
The actual implementation returned by builder.buildThreadSafeForyPool is
ThreadPoolFory, which extends AbstractThreadSafeFory. Neither of them provides
access to this method or to the underlying Fory instance from the pool.
I can’t avoid using a pooled wrapper because I’m working with virtual threads
and don’t want to implement pool management myself.
GitHub link:
https://github.com/apache/fory/discussions/3150#discussioncomment-15505920
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]