Esempio n. 1
0
        /// <summary>
        /// This method creates a service message and injects it in to the execution path and bypasses the listener infrastructure.
        /// </summary>
        /// <param name="header">The message header to identify the recipient.</param>
        /// <param name="package">The object package to process.</param>
        /// <param name="ChannelPriority">The priority that the message should be processed. The default is 1. If this message is not a valid value, it will be matched to the nearest valid value.</param>
        /// <param name="options">The process options.</param>
        /// <param name="release">The release action which is called when the payload has been executed by the receiving commands.</param>
        /// <param name="responseHeader">This is the optional response header</param>
        /// <param name="ResponseChannelPriority">This is the response channel priority. This will be set if the response header is not null. The default priority is 1.</param>
        /// <param name="originatorServiceId">This optional parameter allows you to set the originator serviceId</param>
        public void Process(ServiceMessageHeader header
                            , object package                      = null
                            , int ChannelPriority                 = 1
                            , ProcessOptions options              = ProcessOptions.RouteExternal | ProcessOptions.RouteInternal
                            , Action <bool, Guid> release         = null
                            , ServiceMessageHeader responseHeader = null
                            , int ResponseChannelPriority         = 1
                            , string originatorServiceId          = null
                            )
        {
            var message = new ServiceMessage(header, responseHeader);

            if (originatorServiceId != null)
            {
                message.OriginatorServiceId = originatorServiceId;
            }

            message.ChannelPriority = ChannelPriority;
            if (package != null)
            {
                message.Blob = mSerializer.PayloadSerialize(package);
            }

            if (responseHeader != null)
            {
                message.ResponseChannelPriority = ResponseChannelPriority;
            }

            Process(message, options, release);
        }
Esempio n. 2
0
        /// <summary>
        /// This method creates a service message and injects it in to the execution path and bypasses the listener infrastructure.
        /// </summary>
        /// <param name="header">The message header to identify the recipient.</param>
        /// <param name="package">The objet package to process.</param>
        /// <param name="ChannelPriority">The prioirty that the message should be processed. The default is 1. If this message is not a valid value, it will be matched to the nearest valid value.</param>
        /// <param name="options">The process options.</param>
        /// <param name="release">The release action which is called when the payload has been executed.</param>
        /// by the receiving commands.</param>
        public void Process(ServiceMessageHeader header
                            , object package              = null
                            , int ChannelPriority         = 1
                            , ProcessOptions options      = ProcessOptions.RouteExternal | ProcessOptions.RouteInternal
                            , Action <bool, Guid> release = null)
        {
            var message = new ServiceMessage(header);

            message.ChannelPriority = ChannelPriority;
            if (package != null)
            {
                message.Blob = mSerializer.PayloadSerialize(package);
            }

            Process(message, options, release);
        }
 public static void PayloadPack(this TransmissionPayload incoming, IPayloadSerializationContainer c)
 {
     incoming.Message.Blob = c.PayloadSerialize(incoming.MessageObject);
 }
 public static void PayloadPack <O>(this TransmissionPayload incoming, IPayloadSerializationContainer c, O data)
 {
     incoming.Message.Blob = c.PayloadSerialize(data);
 }