Class SerializedData

java.lang.Object
org.jcsp.net.dynamic.SerializedData
All Implemented Interfaces:
Externalizable, Serializable

class SerializedData extends Object implements Externalizable
Serialized form of an object as as part of a DynamicClassLoaderMessage. The object is serialized to a byte array for transfer to another node. This will allow the message to be deserialized to obtain the JFTP reference even if the class held here is not available. When the relevant class has been loaded the data from the byte array can be deserialized.
  • Field Details

    • serializedData

      private byte[] serializedData
      The binary form of the object in this message.
    • objectToString

      private String objectToString
      The string representation of the object.
  • Constructor Details

    • SerializedData

      public SerializedData(Object obj, boolean storeToString) throws NotSerializableException, IOException
      This is the public used constructor. It takes an object and attempts to serialize it.
      Parameters:
      obj - the Object to Serialize.
      storeToString - if true will create a string representation of the serialized object.
      Throws:
      NotSerializableException - If obj is not Serializable.
      IOException - if an IO error occurs during Serialization, should not happen unless there is a bug.
    • SerializedData

      SerializedData(byte[] data, String objectToString)
      A private constructor used during the deserialization process of this object. Externalizable objects require a no-arg constructor so a replacement object is serialized in this object's place. On deserialization, this object is reconstructed using this constructor.
      Parameters:
      data - a byte[] containing the serialized data of the object that this object is holding.
      objectToString - The toString value of the stored object.
  • Method Details