{
AbstractJMSMessage newMessage;
if (message instanceof BytesMessage)
{
newMessage = new MessageConverter(_session, (BytesMessage) message).getConvertedMessage();
}
else if (message instanceof MapMessage)
{
newMessage = new MessageConverter(_session, (MapMessage) message).getConvertedMessage();
}
else if (message instanceof ObjectMessage)
{
newMessage = new MessageConverter(_session, (ObjectMessage) message).getConvertedMessage();
}
else if (message instanceof TextMessage)
{
newMessage = new MessageConverter(_session, (TextMessage) message).getConvertedMessage();
}
else if (message instanceof StreamMessage)
{
newMessage = new MessageConverter(_session, (StreamMessage) message).getConvertedMessage();
}
else
{
newMessage = new MessageConverter(_session, message).getConvertedMessage();
}
if (newMessage != null)
{
return newMessage;