Interface SessionSerializer<T,IN,OUT>

All Known Implementing Classes:
AbstractDataSerializableSessionSerializer, AbstractPdxSerializableSessionSerializer, DataSerializableSessionAttributesSerializer, DataSerializableSessionSerializer, DataSerializerSessionSerializerAdapter, PdxSerializableSessionSerializer, PdxSerializerSessionSerializerAdapter

public interface SessionSerializer<T,IN,OUT>
The SessionSerializer interface is a Service Provider Interface (SPI) for providers needing to provide a custom implementation of their serialization strategy.
Since:
2.0.0
  • Method Details

    • serialize

      void serialize(T session, OUT out)
      Serializes the given Object to the provided out stream.
      Parameters:
      session - Object to serialize.
      out - stream in which to write the bytes of the Object.
    • deserialize

      T deserialize(IN in)
      Deserializes an Object from bytes contained in the provided in stream.
      Parameters:
      in - stream from which to read the bytes of the Object.
      Returns:
      the deserialized Object.
    • canSerialize

      boolean canSerialize(Class<?> type)
      Determines whether the given type can be de/serialized by this SessionSerializer.
      Parameters:
      type - Class to evaluate for whether de/serialization is supported.
      Returns:
      a boolean value indicating whether the specified type can be de/serialized by this SessionSerializer.
      See Also:
    • canSerialize

      default boolean canSerialize(Object obj)
      Determines whether the given Object can be de/serialized by this SessionSerializer.
      Parameters:
      obj - Object to evaluate for whether de/serialization is supported.
      Returns:
      a boolean value indicating whether the specified Object can be de/serialized by this SessionSerializer.
      See Also: