Class DefaultSerializerDeserializer
java.lang.Object
io.micronaut.jms.serdes.DefaultSerializerDeserializer
- All Implemented Interfaces:
Deserializer, Serializer
@Singleton
public final class DefaultSerializerDeserializer
extends Object
implements Serializer, Deserializer
Default implementation of
Serializer and Deserializer. It is the
default implementation of both types, so applications
can add named serializers and deserializers for the serializer and deserializer members of
@Queue and @Topic, and can still replace the global one with a @Primary bean, a bean with a
higher precedence @Order, or @Replaces(DefaultSerializerDeserializer.class).- Since:
- 1.0.0
- Author:
- Elliott Pope
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(jakarta.jms.Message message, io.micronaut.core.type.Argument<T> argument) Extract the body of the message into the specified type.<T> Tdeserialize(jakarta.jms.Message message, Class<T> clazz) Extract the body of the message into the specified type.jakarta.jms.MessageCreate a message from the body.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Deserializer
deserialize
-
Constructor Details
-
DefaultSerializerDeserializer
public DefaultSerializerDeserializer(io.micronaut.context.BeanLocator beanLocator)
-
-
Method Details
-
deserialize
Description copied from interface:DeserializerExtract the body of the message into the specified type.- Specified by:
deserializein interfaceDeserializer- Type Parameters:
T- the type- Parameters:
message- the messageclazz- the type- Returns:
- the extracted message body as an instance of the specified type
-
deserialize
public <T> T deserialize(jakarta.jms.Message message, io.micronaut.core.type.Argument<T> argument) Description copied from interface:DeserializerExtract the body of the message into the specified type.The default implementation delegates to
Deserializer.deserialize(Message, Class)and only usesTypeInformation.getType(), so it does not preserve type variables. Implementers should override this method to support generic-aware deserialization.- Specified by:
deserializein interfaceDeserializer- Type Parameters:
T- the type- Parameters:
message- the messageargument- the argument- Returns:
- the extracted message body as an instance of the specified type
-
serialize
Description copied from interface:SerializerCreate a message from the body.- Specified by:
serializein interfaceSerializer- Parameters:
session- the JMS sessionbody- the message body- Returns:
- the message
-