Ejemplo n.º 1
0
		private void HandleOutMessage(RelayMessageWithContext messageWithContext)
		{
			try
			{
				counters.CountInputBytes(messageWithContext.RelayMessage);
				components.HandleOutMessage(messageWithContext);
				countersInternal.CountOutMessage(messageWithContext.RelayMessage);
				if (messageWithContext.RelayMessage.AllowsReturnPayload == false) messageWithContext.RelayMessage.Payload = null;
			}
			catch (Exception exc)
			{
                if (log.IsErrorEnabled)
                    log.ErrorFormat("Error handling message {0}: {1}", messageWithContext.RelayMessage, exc);				
			}
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Use this method to process an 'In' <see cref="RelayMessage"/> while providing a list of 
		/// component types that should not receive the message.
		/// </summary>
		/// <param name="message">The message to process</param>
		/// <param name="exclusionList">The components that should not receive the message</param>
		/// <exception cref="InvalidOperationException"> This exception is thrown if the message is NOT an 'In 'message type </exception>
		void IRelayNodeServices.HandleInMessageWithComponentExclusionList(RelayMessage message, params Type[] exclusionList)
		{

			if (message != null)
			{
				if (message.MessageType == MessageType.Get ||
					 message.MessageType == MessageType.Query ||
					 message.MessageType == MessageType.Invoke)
				{
					throw new InvalidOperationException("HandleInMessageWithComponentExclusionList() processes 'In' MessageTypes Only.  Encountred Out MessageType: " + message.MessageType);
				}

				messageTracer.WriteMessageInfo(message);

				if (components.DoHandleMessagesOfType(message.MessageType))
				{
					#region Assign SourceZone
					if (message.SourceZone == 0)
					{
						message.SourceZone = MyZone;
					}
					#endregion

					// Create RelayMessageWithContext                   
					RelayMessageWithContext msgWithContext =
						 new RelayMessageWithContext(
							  message,
							  new RelayMessageProcessingContext(exclusionList));

					//post message to async queue
					inMessageWithContextPort.Post(msgWithContext);
				}
			}
		}
Ejemplo n.º 3
0
		private void HandleInMessage(RelayMessageWithContext messageWithContext)
		{
			try
			{
				counters.CountInputBytes(messageWithContext.RelayMessage);
				components.HandleInMessage(messageWithContext);
				countersInternal.CountInMessage(messageWithContext.RelayMessage);
			}
			catch (Exception exc)
			{
                if (log.IsErrorEnabled)
                    log.ErrorFormat("Error handling message {0}: {1}", messageWithContext.RelayMessage, exc);				
			}
		}