public static ActiveMQDestination Transform(IDestination destination)
{
ActiveMQDestination result = null;
if(destination != null)
{
if(destination is ActiveMQDestination)
{
result = (ActiveMQDestination) destination;
}
else
{
if(destination is ITemporaryQueue)
{
result = new ActiveMQTempQueue(((IQueue) destination).QueueName);
}
else if(destination is ITemporaryTopic)
{
result = new ActiveMQTempTopic(((ITopic) destination).TopicName);
}
else if(destination is IQueue)
{
result = new ActiveMQQueue(((IQueue) destination).QueueName);
}
else if(destination is ITopic)
{
result = new ActiveMQTopic(((ITopic) destination).TopicName);
}
}
}
return result;
}