示例#1
0
		public virtual bool Equals(ProducerId that) {
            if (! Equals(this.ConnectionId, that.ConnectionId)) return false;
            if (! Equals(this.Value, that.Value)) return false;
            if (! Equals(this.SessionId, that.SessionId)) return false;
            return true;

		}
示例#2
0
 public virtual bool Equals(ProducerId that)
 {
     if (!Equals(this.ConnectionId, that.ConnectionId))
     {
         return(false);
     }
     if (!Equals(this.Value, that.Value))
     {
         return(false);
     }
     if (!Equals(this.SessionId, that.SessionId))
     {
         return(false);
     }
     return(true);
 }
示例#3
0
                protected virtual ProducerInfo CreateProducerInfo(IDestination destination)
                {
                        ProducerInfo answer = new ProducerInfo();
                        ProducerId id = new ProducerId();
                        id.ConnectionId = info.SessionId.ConnectionId;
                        id.SessionId = info.SessionId.Value;
                        lock (this)
                        {
                                id.Value = ++producerCounter;
                        }
                        answer.ProducerId = id;
                        answer.Destination = ActiveMQDestination.Transform(destination);

                        answer.Destination = ActiveMQDestination.Transform(destination);

                        // If the destination contained a URI query, then use it to set public
                        // properties on the ProducerInfo
                        ActiveMQDestination amqDestination = destination as ActiveMQDestination;
                        if (amqDestination != null && amqDestination.Options != null)
                        {
                                Util.URISupport.SetProperties(answer, amqDestination.Options, "producer.");
                        }

                        return answer;
                }
示例#4
0
		public static ProducerId ToProducerId(string text)
		{
			if (text == null)
			{
				return null;
			}
			ProducerId answer = new ProducerId();
			int idx = text.LastIndexOf(':');
			if (idx >= 0) {
				answer.Value = Int32.Parse(text.Substring(idx + 1));
				text = text.Substring(0, idx);
				idx = text.LastIndexOf(':');
				if (idx >= 0) {
					answer.SessionId = Int32.Parse(text.Substring(idx + 1));
					text = text.Substring(0, idx);
				}
			}
			answer.ConnectionId = text;
			return answer;
		}
示例#5
0
		public static string ToStomp(ProducerId id)
		{
			return id.ConnectionId + ":" + id.SessionId + ":" + id.Value;
		}