// Do our best to convert the ref. to one of our native types
if (destination instanceof DestinationRef)
dstMessage.setJMSDestination(destination);
else
if (destination instanceof Queue)
dstMessage.setJMSDestination(new QueueRef(((Queue)destination).getQueueName()));
else
if (destination instanceof Topic)
dstMessage.setJMSDestination(new TopicRef(((Topic)destination).getTopicName()));
}
dstMessage.setJMSExpiration(srcMessage.getJMSExpiration());
dstMessage.setJMSMessageID(srcMessage.getJMSMessageID());
dstMessage.setJMSPriority(srcMessage.getJMSPriority());
dstMessage.setJMSRedelivered(srcMessage.getJMSRedelivered());
dstMessage.setJMSReplyTo(srcMessage.getJMSReplyTo());
Destination replyTo = srcMessage.getJMSReplyTo();
if (replyTo != null)
{
// Do our best to convert the ref. to one of our native types
if (replyTo instanceof DestinationRef)
dstMessage.setJMSReplyTo(replyTo);
else
if (replyTo instanceof Queue)
dstMessage.setJMSReplyTo(new QueueRef(((Queue)replyTo).getQueueName()));
else
if (replyTo instanceof Topic)
dstMessage.setJMSReplyTo(new TopicRef(((Topic)replyTo).getTopicName()));
}