org.axonframework.saga.repository
Interface SagaSerializer

All Known Implementing Classes:
JavaSagaSerializer, XStreamSagaSerializer

public interface SagaSerializer

Interface towards a serialization mechanism for Saga instances.

Since:
0.7
Author:
Allard Buijze

Method Summary
 Saga deserialize(byte[] serializedSaga)
          Deserializes the given serializedSaga.
 byte[] serialize(Saga saga)
          Serialize the given saga to a byte array.
 

Method Detail

serialize

byte[] serialize(Saga saga)
Serialize the given saga to a byte array.

Parameters:
saga - The saga to serialize
Returns:
The bytes representing the serialized form of the Saga
Throws:
SerializationException - if a technical error occurs while deserializing the Saga

deserialize

Saga deserialize(byte[] serializedSaga)
Deserializes the given serializedSaga.

Parameters:
serializedSaga - the bytes representing the serialized form of a Saga
Returns:
The Saga instance represented by the given bytes
Throws:
ClassCastException - if the given bytes do not represent a Saga
SerializationException - if a technical error occurs while deserializing the Saga


Copyright © 2011. All Rights Reserved.