if (destination instanceof ActiveMQDestination) {
return (ActiveMQDestination)destination;
} else {
if (destination instanceof TemporaryQueue) {
activeMQDestination = new ActiveMQTempQueue(((Queue)destination).getQueueName());
} else if (destination instanceof TemporaryTopic) {
activeMQDestination = new ActiveMQTempTopic(((Topic)destination).getTopicName());
} else if (destination instanceof Queue) {
activeMQDestination = new ActiveMQQueue(((Queue)destination).getQueueName());
} else if (destination instanceof Topic) {