Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1500

SerializationType doesn't visit AdvancedExternalizersType

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 5.0.1.FINAL
    • Configuration
    • None
    • Workaround Exists
    • Hide

      Workaround is to use reflection on the SerializationType to get the AdvancedExternalizersType and then to use reflection on that to get the List<AdvancedSerializationConfig>. This however is very prone to break if any method names or types change, where as with the fix I can do everything using basically public API's.

      Show
      Workaround is to use reflection on the SerializationType to get the AdvancedExternalizersType and then to use reflection on that to get the List<AdvancedSerializationConfig>. This however is very prone to break if any method names or types change, where as with the fix I can do everything using basically public API's.

    Description

      Using infinispan, we have multiple infinispan.xml files that are used to configure our caches. The overrides used on default and cache configurations work great for this. I noticed there is no override global configuration support. So I was trying to make my own for the stuff we needed. One of the items we need to "override" is the serialization configs (it is more additive than override).

      When doing this I found that the SerializationType doesn't properly pass off the vistor to the AdvancedExternalizersType and thus I can't visit the Type or Configs, which would make doing this much easier.

      I was hoping I could keep a List of AdvancedSerializationConfigs that it visits and then in my override method just add these Configs 1 by 1 to the SerializationType since it has the public methods to add AdvancedSerializers.

      It seems to be just an oversight but I would expect the accept method of SerializationType to be the following instead (just added the accept to AdvancedExternalizersType).

      public void accept(ConfigurationBeanVisitor v) {
          this.externalizerTypes.accept(v);
          v.visitSerializationType(this);
      }
      

      Side note I noticed the AdvancedExternalizersType has addExternalizer as package level. It would be easier to just call that method instead of having to detect the id myself and whether an object or class is configured in the AdvancedSerializerConfig to decide what add to call, since I could just do a straight add of the Config.

      Also there is no way to remove or detect what AdvancedSerializers are present on the SerializationType, which would be very helpful when trying to replace a given AdvancedSerializers. Or are the AdvancedSerializerConfigs used started at the end of the list? This would be preferable, because then I wouldn't care if another existed since the one I just added would take priority.

      Attachments

        Activity

          People

            manik_jira Manik Surtani (Inactive)
            rpwburns William Burns (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: