Ejemplo n.º 1
0
        /// <summary>
        /// Create a Destination using the name given, the type is determined by the
        /// value of the type parameter.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="pyhsicalName"></param>
        /// <param name="remote"></param>
        /// <returns></returns>
        public static Destination CreateDestination(int type, String pyhsicalName, bool remote)
        {
            Destination result = null;

            if (pyhsicalName == null)
            {
                return(null);
            }
            else
            {
                switch (type)
                {
                case STOMP_TOPIC:
                    result = new Topic(pyhsicalName);
                    break;

                case STOMP_TEMPORARY_TOPIC:
                    result = new TempTopic(pyhsicalName);
                    break;

                case STOMP_QUEUE:
                    result = new Queue(pyhsicalName);
                    break;

                default:
                    result = new TempQueue(pyhsicalName);
                    break;
                }
            }

            result.RemoteDestination = remote;

            return(result);
        }
Ejemplo n.º 2
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 == STOMP_TOPIC)
            {
                result = new Topic(pyhsicalName);
            }
            else if (type == STOMP_TEMPORARY_TOPIC)
            {
                result = new TempTopic(pyhsicalName);
            }
            else if (type == STOMP_QUEUE)
            {
                result = new Queue(pyhsicalName);
            }
            else
            {
                result = new TempQueue(pyhsicalName);
            }
            return(result);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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.
            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);
        }