Interface MessageSerializer
- All Superinterfaces:
no.mnemonic.commons.metrics.MetricAspect
- All Known Implementing Classes:
DefaultJavaMessageSerializer
,XStreamMessageSerializer
public interface MessageSerializer
extends no.mnemonic.commons.metrics.MetricAspect
-
Method Summary
Modifier and TypeMethodDescription<T extends Message>
Tdeserialize
(byte[] msgbytes, ClassLoader classLoader) Deserialize bytes into a messagebyte[]
Serialize the messageMethods inherited from interface no.mnemonic.commons.metrics.MetricAspect
getMetrics
-
Method Details
-
serializerID
String serializerID()- Returns:
- a serializer identifier, to allow JMS receiver to distinguish between sender formats
-
serialize
Serialize the message- Parameters:
msg
- message to serialize- Returns:
- message in serialized format
- Throws:
IOException
- if serialization fails
-
deserialize
Deserialize bytes into a message- Type Parameters:
T
- expected message type- Parameters:
msgbytes
- message bytesclassLoader
- classloader which knows any involved types- Returns:
- the deserialized message
- Throws:
IOException
- if deserialization fails
-