Interface EvolvableObject


public interface EvolvableObject
Defines an interface that should be implemented by the classes that want to support evolution.
Since:
12.2.1
Author:
as 2013.04.24
  • Method Details

    • getEvolvable

      Evolvable getEvolvable(int nTypeId)
      Return Evolvable object for the specified type id.

      This method should only return Evolvable instance if the specified type id matches its own type id. Otherwise, it should delegate to the parent:

           // assuming type ID == 1234 and impl. version == 3
           private Evolvable evolvable = new SimpleEvolvable(3);
           ...
           public Evolvable getEvolvable(int nTypeId)
               {
               if (1234 == nTypeId)
                   {
                   return this.evolvable;
                   }
      
               return super.getEvolvable(nTypeId);
               }
       
      Parameters:
      nTypeId - type id to get Evolvable instance for
      Returns:
      Evolvable instance for the specified type id
    • getEvolvableHolder

      EvolvableHolder getEvolvableHolder()
      Return EvolvableHolder that should be used to store information about evolvable objects that are not known during deserialization.

      For example, it is possible to evolve the class hierarchy by adding new classes at any level in the hierarchy. Normally this would cause a problem during deserialization on older clients that don't have new classes at all, but EvolvableHolder allows us to work around that issue and simply store type id to opaque binary value mapping within it.

      Returns:
      EvolvableHolder instance