org.axonframework.serializer
Interface SerializationAware

All Known Implementing Classes:
SerializationAwareDomainEventMessage, SerializationAwareEventMessage, SerializedDomainEventMessage, SerializedEventMessage, SerializedMessage, SerializedObjectHolder

public interface SerializationAware

Marker interface for messages that have special serialization awareness. Typically, implementations will optimize the serialization process by reusing serialized formats across invocations. This is particularly useful in cases where an object needs to be serialized more than once using the same serializer.

Since:
2.0
Author:
Allard Buijze

Method Summary
<T> SerializedObject<T>
serializeMetaData(Serializer serializer, Class<T> expectedRepresentation)
          Serialize the meta data of this message using given serializer, using given expectedRepresentation.
<T> SerializedObject<T>
serializePayload(Serializer serializer, Class<T> expectedRepresentation)
          Serialize the payload of this message using given serializer, using given expectedRepresentation.
 

Method Detail

serializePayload

<T> SerializedObject<T> serializePayload(Serializer serializer,
                                         Class<T> expectedRepresentation)
Serialize the payload of this message using given serializer, using given expectedRepresentation. This method should return the same SerializedObject instance when invoked multiple times using the same serializer.

Type Parameters:
T - The type of data to serialize to
Parameters:
serializer - The serializer to serialize payload with
expectedRepresentation - The type of data to serialize to
Returns:
a SerializedObject containing the serialized representation of the message's payload

serializeMetaData

<T> SerializedObject<T> serializeMetaData(Serializer serializer,
                                          Class<T> expectedRepresentation)
Serialize the meta data of this message using given serializer, using given expectedRepresentation. This method should return the same SerializedObject instance when invoked multiple times using the same serializer.

Type Parameters:
T - The type of data to serialize to
Parameters:
serializer - The serializer to serialize meta data with
expectedRepresentation - The type of data to serialize to
Returns:
a SerializedObject containing the serialized representation of the message's meta data


Copyright © 2010-2016. All Rights Reserved.