C# Class 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).

Inheritance: IMessageConverter
Afficher le fichier Open project: spring-projects/spring-net Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Method Details

CreateMessageForByteArray() protected méthode

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 ///
Résultat IBytesMessage

CreateMessageForMap() protected méthode

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 ///
Résultat IMapMessage

CreateMessageForSerializable() protected méthode

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 ///
Résultat IObjectMessage

CreateMessageForString() protected méthode

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 ///
Résultat ITextMessage

ExtractByteArrayFromMessage() protected méthode

Extract a byte array from the given IBytesMessage.
protected ExtractByteArrayFromMessage ( IBytesMessage message ) : byte[]
message IBytesMessage the message to convert ///
Résultat byte[]

ExtractMapFromMessage() protected méthode

Extract a IDictionary from the given IMapMessage.
protected ExtractMapFromMessage ( IMapMessage message ) : IDictionary
message IMapMessage the message to convert ///
Résultat IDictionary

ExtractSerializableFromMessage() protected méthode

Extracts the serializable object from the given object message.
protected ExtractSerializableFromMessage ( IObjectMessage message ) : object
message IObjectMessage The message to convert.
Résultat object

ExtractStringFromMessage() protected méthode

Extract a String from the given ITextMessage.
protected ExtractStringFromMessage ( ITextMessage message ) : string
message ITextMessage the message to convert ///
Résultat string

FromMessage() public méthode

Convert from a NMS Message to a .NET object.
public FromMessage ( IMessage messageToConvert ) : object
messageToConvert IMessage the message to convert ///
Résultat object

ToMessage() public méthode

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 ///
Résultat IMessage