Uploaded image for project: 'Commons SCXML'
  1. Commons SCXML
  2. SCXML-247

Provide dedicated SCInstanceObjectInputStream to support proper dynamic class resolution in GroovyContext

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • None

    Description

      The GroovyContext requires custom deserialization of its variables to allow dynamic resolving of Groovy Object classes.
      Currently this is done by temporarily 'intercepting' the default deserialization in readObject through an extended ObjectInputStream with an override of the resolveClass method.

      However, this is not a reliable solution if/when the context variables contains an Object also otherwise referenced in SCInstance (the (de)serialization root object).
      In that case two instances of such Object will be deserialized because the two ObjectInputStream instances are not aware of each other.

      To solve this problem proper (see SCXML-239 for a use-case, which has been fixed 'quick and dirty'), an extended ObjectInputStream implementation will be introduced.
      This SCInstanceObjectInputStream will allow to (temporarily) configure a resolveClass callback method, which then can be leveraged by the GroovyContext readObject method.

      SCInstance deserialization hereafter then should use this SCInstanceObjectInputStream class instead, at least when using Groovy.

      Attachments

        Issue Links

          Activity

            People

              ate Ate Douma
              ate Ate Douma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: