C# Класс Spring.Messaging.Nms.Support.Converter.SimpleMessageConverter

A simple message converter that can handle ITextMessages, IBytesMessages, IMapMessages, and IObjectMessages. Used as default by NmsTemplate, for ConvertAndSend and ReceiveAndConvert operations.

Converts a String to a NMS ITextMessage, a byte array to a NMS IBytesMessage, a Map to a NMS IMapMessage, and a Serializable object to a NMS IObjectMessage (or vice versa).

Наследование: IMessageConverter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FromMessage ( IMessage messageToConvert ) : object

Convert from a NMS Message to a .NET object.

ToMessage ( object objectToConvert, ISession session ) : IMessage

Convert a .NET object to a NMS Message using the supplied session to create the message object.

Защищенные методы

Метод Описание
CreateMessageForByteArray ( byte bytes, ISession session ) : IBytesMessage

Create a NMS IBytesMessage for the given byte array.

CreateMessageForMap ( IDictionary map, ISession session ) : IMapMessage

Create a NMS IMapMessage for the given Map.

CreateMessageForSerializable ( object objectToSend, ISession session ) : IObjectMessage

Create a NMS IObjectMessage for the given Serializable object.

CreateMessageForString ( string text, ISession session ) : ITextMessage

Create a NMS ITextMessage for the given String.

ExtractByteArrayFromMessage ( IBytesMessage message ) : byte[]

Extract a byte array from the given IBytesMessage.

ExtractMapFromMessage ( IMapMessage message ) : IDictionary

Extract a IDictionary from the given IMapMessage.

ExtractSerializableFromMessage ( IObjectMessage message ) : object

Extracts the serializable object from the given object message.

ExtractStringFromMessage ( ITextMessage message ) : string

Extract a String from the given ITextMessage.

Описание методов

CreateMessageForByteArray() защищенный Метод

Create a NMS IBytesMessage for the given byte array.
protected CreateMessageForByteArray ( byte bytes, ISession session ) : IBytesMessage
bytes byte the byyte array to convert ///
session ISession current NMS session ///
Результат IBytesMessage

CreateMessageForMap() защищенный Метод

Create a NMS IMapMessage for the given Map.
protected CreateMessageForMap ( IDictionary map, ISession session ) : IMapMessage
map IDictionary the Map to convert ///
session ISession current NMS session ///
Результат IMapMessage

CreateMessageForSerializable() защищенный Метод

Create a NMS IObjectMessage for the given Serializable object.
protected CreateMessageForSerializable ( object objectToSend, ISession session ) : IObjectMessage
objectToSend object the Serializable object to convert ///
session ISession current NMS session ///
Результат IObjectMessage

CreateMessageForString() защищенный Метод

Create a NMS ITextMessage for the given String.
protected CreateMessageForString ( string text, ISession session ) : ITextMessage
text string the String to convert ///
session ISession current NMS session ///
Результат ITextMessage

ExtractByteArrayFromMessage() защищенный Метод

Extract a byte array from the given IBytesMessage.
protected ExtractByteArrayFromMessage ( IBytesMessage message ) : byte[]
message IBytesMessage the message to convert ///
Результат byte[]

ExtractMapFromMessage() защищенный Метод

Extract a IDictionary from the given IMapMessage.
protected ExtractMapFromMessage ( IMapMessage message ) : IDictionary
message IMapMessage the message to convert ///
Результат IDictionary

ExtractSerializableFromMessage() защищенный Метод

Extracts the serializable object from the given object message.
protected ExtractSerializableFromMessage ( IObjectMessage message ) : object
message IObjectMessage The message to convert.
Результат object

ExtractStringFromMessage() защищенный Метод

Extract a String from the given ITextMessage.
protected ExtractStringFromMessage ( ITextMessage message ) : string
message ITextMessage the message to convert ///
Результат string

FromMessage() публичный Метод

Convert from a NMS Message to a .NET object.
public FromMessage ( IMessage messageToConvert ) : object
messageToConvert IMessage the message to convert ///
Результат object

ToMessage() публичный Метод

Convert a .NET object to a NMS Message using the supplied session to create the message object.
public ToMessage ( object objectToConvert, ISession session ) : IMessage
objectToConvert object the object to convert ///
session ISession the Session to use for creating a NMS Message ///
Результат IMessage