com.netflix.zeno.serializer
Class SerializationFramework
java.lang.Object
com.netflix.zeno.serializer.SerializationFramework
- Direct Known Subclasses:
- DiffSerializationFramework, FastBlobStateEngine, GenericObjectSerializationFramework, HashSerializationFramework, JsonSerializationFramework
public abstract class SerializationFramework
- extends java.lang.Object
An implementation of the abstract class SerializationFramework will describe some operation
that can be performed on data in a semantically and structurally agnostic way.
For a given POJO model, a set of NFTypeSerializer
implementations must be created to describe their
structure. A set of serializers, identified by a SerializerFactory, is passed into the constructor
of this Object.
The SerializationFramework implementation will traverse this hierarchy of serializers in order to
perform its operation.
Example implementations of SerializationFramework are:
HashSerializationFramework: Calculates an MD5 sum for POJOs conforming to the NFTypeSerializers.
JsonSerializationFramework: Translates POJOs to json (and vice versa)
FastBlobSerializationFramework: Creates binary dumps of data states represented by POJOs
By maintaining a clean separation of data semantics / structure and the operations which can be performed
on the data, we avoid multiplying the work required to maintain our data model by the number of operations
we can perform.
Supporting new functionality is easy; we can define a new SerializationFramework. Adding to the data model
is easy; we simply create / modify NFTypeSerializer
s
For details about how to create new SerializationFramework implementations, check out the section
creating new operations in the
Zeno documentation.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
frameworkSerializer
protected FrameworkSerializer<?> frameworkSerializer
frameworkDeserializer
protected FrameworkDeserializer<?> frameworkDeserializer
topLevelSerializers
protected NFTypeSerializer<?>[] topLevelSerializers
SerializationFramework
public SerializationFramework(SerializerFactory serializerFactory)
getFrameworkSerializer
public FrameworkSerializer getFrameworkSerializer()
getFrameworkDeserializer
public FrameworkDeserializer getFrameworkDeserializer()
getOrderedSerializers
public java.util.List<NFTypeSerializer<?>> getOrderedSerializers()
- Returns:
- the NFTypeSerializers ordered such that dependencies come *before* their dependents.
getSerializer
public <T> NFTypeSerializer<T> getSerializer(java.lang.String typeName)
getTopLevelSerializers
public NFTypeSerializer<?>[] getTopLevelSerializers()