A Temporary Queue
Inheritance: TempDestination, ITemporaryQueue
Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        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.
            TempQueue o = (TempQueue)base.Clone();

            // Now do the deep work required
            // If any new variables are added then this routine will
            // likely need updating

            return(o);
        }
Exemplo n.º 4
0
 /// <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;
 }
Exemplo n.º 5
0
 /// <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;
 }