/// <summary> /// Create a Destination /// </summary> /// <param name="type"></param> /// <param name="pyhsicalName"></param> /// <returns></returns> public static Destination CreateDestination(int type, String pyhsicalName) { Destination result = null; if (pyhsicalName == null) { return(null); } else if (type == TOPIC) { result = new Topic(pyhsicalName); } else if (type == TEMPORARY_TOPIC) { result = new TempTopic(pyhsicalName); } else if (type == QUEUE) { result = new Queue(pyhsicalName); } else { result = new TempQueue(pyhsicalName); } return(result); }
/// <summary> /// </summary> /// <param name="destination"></param> /// <returns></returns> public static Destination Transform(IDestination destination) { Destination result = null; if (destination != null) { if (destination is Destination) { result = (Destination)destination; } else { if (destination is ITemporaryQueue) { result = new TempQueue(((IQueue)destination).QueueName); } else if (destination is ITemporaryTopic) { result = new TempTopic(((ITopic)destination).TopicName); } else if (destination is IQueue) { result = new Queue(((IQueue)destination).QueueName); } else if (destination is ITopic) { result = new Topic(((ITopic)destination).TopicName); } } } return(result); }
public override Object Clone() { // Since we are a derived class use the base's Clone() // to perform the shallow copy. Since it is shallow it // will include our derived class. Since we are derived, // this method is an override. TempTopic o = (TempTopic)base.Clone(); // Now do the deep work required // If any new variables are added then this routine will // likely need updating return(o); }
/// <summary> /// Create a Destination /// </summary> /// <param name="type"></param> /// <param name="pyhsicalName"></param> /// <returns></returns> public static Destination CreateDestination(int type, String pyhsicalName) { Destination result = null; if(pyhsicalName == null) { return null; } else if(type == TOPIC) { result = new Topic(pyhsicalName); } else if(type == TEMPORARY_TOPIC) { result = new TempTopic(pyhsicalName); } else if(type == QUEUE) { result = new Queue(pyhsicalName); } else { result = new TempQueue(pyhsicalName); } return result; }
/// <summary> /// </summary> /// <param name="destination"></param> /// <returns></returns> public static Destination Transform(IDestination destination) { Destination result = null; if(destination != null) { if(destination is Destination) { result = (Destination) destination; } else { if(destination is ITemporaryQueue) { result = new TempQueue(((IQueue) destination).QueueName); } else if(destination is ITemporaryTopic) { result = new TempTopic(((ITopic) destination).TopicName); } else if(destination is IQueue) { result = new Queue(((IQueue) destination).QueueName); } else if(destination is ITopic) { result = new Topic(((ITopic) destination).TopicName); } } } return result; }