示例#1
0
		public IIntegrationMessage Execute(IPipeliningContext pipeliningContext)
		{
			this.WriteLogSynchronized("PIPELINE: Excuting send pipeline on thread '{0}'.", Thread.CurrentThread.ManagedThreadId);

			if ((object)pipeliningContext == null)
				throw new ArgumentNullException("pipeliningContext");

			return null;
		}
示例#2
0
		public IEnumerable<IIntegrationMessage> Execute(IPipeliningContext pipeliningContext, IIntegrationMessage integrationMessage)
		{
			IReceiveStage receiveStage;

			IEnumerable<IIntegrationMessage> stagedIntegrationMessages;
			IEnumerable<IIntegrationMessage> splitIntegrationMessages;

			List<IIntegrationMessage> accumulatedIntegrationMessages;

			this.WriteLogSynchronized("PIPELINE: Excuting receive pipeline on thread '{0}'.", Thread.CurrentThread.ManagedThreadId);

			if ((object)pipeliningContext == null)
				throw new ArgumentNullException("pipeliningContext");

			if ((object)integrationMessage == null)
				throw new ArgumentNullException("integrationMessage");

			accumulatedIntegrationMessages = new List<IIntegrationMessage>();
			stagedIntegrationMessages = new IIntegrationMessage[] { integrationMessage };

			foreach (Type receiveStageType in this.GetStageTypes().Values)
			{
				receiveStage = Activator.CreateInstance(receiveStageType, true) as IReceiveStage;

				if ((object)receiveStage == null)
					throw new InvalidOperationException("Bad receive stage type.");

				this.TrackStageInstance(receiveStage);

				try
				{
					receiveStage.Initialize();
					receiveStage.Freeze();

					accumulatedIntegrationMessages.Clear();
					foreach (IIntegrationMessage stagedIntegrationMessage in stagedIntegrationMessages)
					{
						splitIntegrationMessages = receiveStage.Execute(pipeliningContext, stagedIntegrationMessage);
						accumulatedIntegrationMessages.AddRange(splitIntegrationMessages);
					}
				}
				finally
				{
					receiveStage.Terminate(); // dispose
				}
			}

			return accumulatedIntegrationMessages;
		}
示例#3
0
		public abstract IIntegrationMessage Execute(IPipeliningContext pipeliningContext);
示例#4
0
		public override IEnumerable<IIntegrationMessage> Execute(IPipeliningContext pipeliningContext, IIntegrationMessage integrationMessage)
		{
			//return new IIntegrationMessage[] { };
			return new IIntegrationMessage[] { integrationMessage };
		}
示例#5
0
		public abstract IEnumerable<IIntegrationMessage> Execute(IPipeliningContext pipeliningContext, IIntegrationMessage integrationMessage);
示例#6
0
		public override IIntegrationMessage Execute(IPipeliningContext pipeliningContext)
		{
			return null;
		}