[
https://issues.apache.org/jira/browse/GEODE-4944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16416192#comment-16416192
]
Darrel Schneider commented on GEODE-4944:
-----------------------------------------
Another one to consider with this is: TypeRegistry.setPdxReadSerialized
This used to be in PdxInstanceImpl. Seems like these two (this one and the
override one) should be changed to show how they are intended to be used.
TypeRegistry.setPdxReadSerialized is only used to disable pdx instance
deserialization. It takes precedence over the override one.
The override one is used to enable pdx instance deserialization.
> Combine GemFireCacheImpl read-serialized methods
> ------------------------------------------------
>
> Key: GEODE-4944
> URL: https://issues.apache.org/jira/browse/GEODE-4944
> Project: Geode
> Issue Type: Improvement
> Components: serialization
> Reporter: Galen O'Sullivan
> Priority: Major
>
> Currently, {{InternalCache}} / {{GemFireCacheImpl}} has multiple ways to set
> a thread-local read-serialized option, with no clear differentiation between
> them or indication of why a person would choose to use one instead of the
> other.
> These two methods were added recently, in 4143a73:
> {code}
> @Override
> public Boolean getPdxReadSerializedOverride() {
> TypeRegistry pdxRegistry = this.getPdxRegistry();
> if (pdxRegistry != null) {
> return pdxRegistry.getPdxReadSerializedOverride();
> }
> return false;
> }
> @Override
> public void setPdxReadSerializedOverride(boolean pdxReadSerialized) {
> TypeRegistry pdxRegistry = this.getPdxRegistry();
> if (pdxRegistry != null) {
> pdxRegistry.setPdxReadSerializedOverride(pdxReadSerialized);
> }
> {code}
> This has been around for a while, and does something slightly different:
> {code}
> @Override
> public void setReadSerializedForCurrentThread(boolean value) {
> PdxInstanceImpl.setPdxReadSerialized(value);
> this.setPdxReadSerializedOverride(value);
> }
> {code}
> Perhaps we could even combine this method if it's obvious what it's doing
> (though that doesn't need to be a part of this method):
> {code}
> // test hook
> @Override
> public void setReadSerializedForTest(boolean value) {
> this.cacheConfig.setPdxReadSerialized(value);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)