Ejemplo n.º 1
0
		/// <summary>
		/// 获取回调对应的配置文件列表
		/// </summary>
		private static void processFiles(IDictionary<DisconfKey, IList<IDisconfUpdate>> inverseMap, DisconfUpdateService disconfUpdateService, IDisconfUpdate iDisconfUpdate)
		{

			// 反索引
			IList<Type> classes = Arrays.asList(disconfUpdateService.classes());
			foreach (Type curClass in classes)
			{

				// 获取其注解
				DisconfFile disconfFile = curClass.getAnnotation(typeof(DisconfFile));
				if (disconfFile == null)
				{

					LOGGER.error("cannot find DisconfFile annotation for class when set callback: {} ", curClass.ToString());
					continue;
				}

				DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.FILE, disconfFile.filename());
				addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
			}

			// 反索引
			IList<string> fileKeyList = Arrays.asList(disconfUpdateService.confFileKeys());
			foreach (string fileKey in fileKeyList)
			{

				DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.FILE, fileKey);
				addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
			}

		}
Ejemplo n.º 2
0
		/// <summary>
		/// 获取回调对应配置项列表
		/// </summary>
		private static void processItems(IDictionary<DisconfKey, IList<IDisconfUpdate>> inverseMap, DisconfUpdateService disconfUpdateService, IDisconfUpdate iDisconfUpdate)
		{

			IList<string> itemKeys = Arrays.asList(disconfUpdateService.itemKeys());

			// 反索引
			foreach (string key in itemKeys)
			{

				DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.ITEM, key);
				addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
			}
		}