예제 #1
0
 /// <summary>
 ///
 /// </summary>
 public void PushStamp(EnvelopeStamp stamp)
 {
     lock (_stamps)
     {
         _stamps.Add(stamp);
     }
 }
예제 #2
0
        /// <summary>
        /// Addressed envelope.
        /// </summary>
        protected Outcomes Send(Envelope envelope)
        {
            if (envelope.Address != null)
            {
                EnvelopeStamp stamp = envelope.Address.PopStamp();
                if (stamp != null)
                {
                    return(Send(stamp.SenderIndex, stamp.ReceiverIndex, envelope, null, false));
                }
            }

            return(Outcomes.Failure);
        }
예제 #3
0
        /// <summary>
        /// Create a responding envelope transport.
        /// </summary>
        public static EnvelopeTransportation CreateResponseTransport(EnvelopeTransportation transport)
        {
            EnvelopeTransportation result         = new EnvelopeTransportation();
            List <EnvelopeStamp>   responseStamps = new List <EnvelopeStamp>();

            lock (transport._stamps)
            {
                for (int i = transport._stamps.Count - 1; i >= 0; i--)
                {
                    EnvelopeStamp sourceStamp = transport._stamps[i];
                    EnvelopeStamp newStamp    = new EnvelopeStamp(sourceStamp.MessageBusStampId, sourceStamp.SenderIndex, sourceStamp.ReceiverIndex);
                    result._stamps.Add(newStamp);
                }
            }

            return(result);
        }
예제 #4
0
        /// <summary>
        /// Create a responding envelope transport.
        /// </summary>
        public static EnvelopeTransportation CreateResponseTransport(EnvelopeTransportation transport)
        {
            EnvelopeTransportation result = new EnvelopeTransportation();
            List<EnvelopeStamp> responseStamps = new List<EnvelopeStamp>();

            lock (transport._stamps)
            {
                for (int i = transport._stamps.Count - 1; i >= 0; i--)
                {
                    EnvelopeStamp sourceStamp = transport._stamps[i];
                    EnvelopeStamp newStamp = new EnvelopeStamp(sourceStamp.MessageBusStampId, sourceStamp.SenderIndex, sourceStamp.ReceiverIndex);
                    result._stamps.Add(newStamp);
                }
            }

            return result;
        }
예제 #5
0
 /// <summary>
 /// 
 /// </summary>
 public void PushStamp(EnvelopeStamp stamp)
 {
     lock (_stamps)
     {
         _stamps.Add(stamp);
     }
 }