コード例 #1
0
        public EndpointDiscoveryMetadata ChooseTarget(FindCriteria criteria = null)
        {
            var choose = new ChooseContext(this, criteria);

            ChooseTarget(choose);
            return(choose.SelectedEndpoint);
        }
コード例 #2
0
		protected override void ChooseTarget(ChooseContext choose)
		{
			choose.ReadList(targets =>
			{
				for (int i = 0; i < targets.Count; ++i)
				{
					var target = targets[i];
					if (choose.Matches(target))
						return target;
				}
				return null;
			});
		}
コード例 #3
0
 protected override void ChooseTarget(ChooseContext choose)
 {
     choose.ReadList(targets =>
     {
         for (int i = 0; i < targets.Count; ++i)
         {
             var target = targets[i];
             if (choose.Matches(target))
             {
                 return(target);
             }
         }
         return(null);
     });
 }
コード例 #4
0
ファイル: RoundRobinPolicy.cs プロジェクト: RookieX/Windsor
		protected override void ChooseTarget(ChooseContext choose)
		{
			choose.ModifyList(targets =>
			{
				var count = targets.Count;
				for (int index = 0; index < count; ++index)
				{
					var target = targets[index];
					if (choose.Matches(target))
					{
						if (count > 1)
						{
							targets.RemoveAt(index);
							targets.Add(target);
						}
						return target;
					}
				}
				return null;
			});
		}
コード例 #5
0
 protected override void ChooseTarget(ChooseContext choose)
 {
     choose.ModifyList(targets =>
     {
         var count = targets.Count;
         for (int index = 0; index < count; ++index)
         {
             var target = targets[index];
             if (choose.Matches(target))
             {
                 if (count > 1)
                 {
                     targets.RemoveAt(index);
                     targets.Add(target);
                 }
                 return(target);
             }
         }
         return(null);
     });
 }
コード例 #6
0
		public EndpointDiscoveryMetadata ChooseTarget(FindCriteria criteria = null)
		{
			var choose = new ChooseContext(this, criteria);
			ChooseTarget(choose);
			return choose.SelectedEndpoint;
		}
コード例 #7
0
		protected abstract void ChooseTarget(ChooseContext choose);
コード例 #8
0
 protected abstract void ChooseTarget(ChooseContext choose);