Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: for the plan.

Jump to: navigation, search


Design Specification: Serializers

ER 406993


Document History

Date Author Version Description & Notes
2013-05-01 James 0.1 Draft

Project overview

This project will provide a pluggable Serializer interface and implementations to allow different serialization mechanisms to be used for any of EclipseLink's usages of serialization.


Serialization means converting an object (or object graph) into a binary or character form.


Support serializer interface and implementations for;

  • Java serialization
  • XML serialization through JAXB
  • JSON serialization through EclipseLink Moxy JAXB
  • Kryo serialization (for optimized binary serialization)
  • API for custom or third party serializer

Support using custom serializer for cache coordination.

Design Constraints

Some serializers require additional configuration or code, the user is responsible for ensuring their objects can be serialized correctly with their serializer.


  • Support Serializer interface, JavaSerializer, XMLSerializer, JSONSerializer, KryoSerializer.
  • Serialization to both byte[] and String will be supported.
  • XML and JSON will use JAXB, JAXBContext can be specified, or package of first descriptor class will be used by default.
  • Cache coordination will send a byte[] instead of Command, which is the serialized Command, if no serializer is used, Command will still be sent as previous.
  • Cache coordination will use Session default serializer if set.
  • Cache coordination will not support XML or JSON (unless user maps change sets through JAXB), will be tested with Kryo.
  • SerializedObjectConverter will support serializers.
  • JPA annotations and XML will allow config of serializer on SerializedObjectConverter, including specifying package for XML/JSON.
  • Serializer package will be defaulted to package of mapping's attribute type.
  • RemoteSession also has some support for serializers.


  • Serializer
  • JavaSerializer
  • XMLSerializer
  • JSONSerializer
  • KryoSerializer
  • Session.setSerializer(Serializer)
  • @SerializedConverter(name, serializerClass, serializerPackage)
  • @Convert reserved names as statics, SERIALIZED, CLASS_INSTANCE, XML, JSON, KRYO


@SerializedConverter(name="binarySerializer", serializerClass=KryoSerializer.class)
public class Employee {
  private Resume resume;
  private JobDetails jobDetails;
  private Image picture;

Config files


  • "eclipselink.cache.coordination.serializer"="<serializer-class>"


Need to document serializers API, and new JPA annotations/xml. Need to document how to use custom serializer with cache coordination.

Open Issues

Issue # Owner Description / Notes


Issue # Description / Notes Decision

Future Considerations

  • Support additional serializers.

Back to the top