Exemple #1
0
        /// <summary>
        /// 初始化服务总线(本地调用不走WCF服务)
        /// </summary>
        public static void InitializeClientBus()
        {
            if (bizbus == null)
            {
                bizbus = new ClientBizBus();
            }

            ClientBizBus cbizbus = bizbus as ClientBizBus;

            List <ServicePackageInfo> packageinfos = ConfigLoader.GetPackageList();
            ServicePackageLoader      loader       = new ServicePackageLoader();
            ServicePackageList        packages     = new ServicePackageList();

            foreach (ServicePackageInfo info in packageinfos)
            {
                IServicePackage package = PackageConverter.Convert2Package(info);
                if (package == null)
                {
                    continue;
                }
                packages.Add(package);
            }
            cbizbus.packages = packages;
            cbizbus.IndexPackage();
        }
Exemple #2
0
        /// <summary>
        /// 移除服务
        /// </summary>
        /// <param name="package"></param>
        public static void RemovePackage(IServicePackage package)
        {
            ClientBizBus cbizbus = bizbus as ClientBizBus;

            cbizbus.packages.Remove(package);
            cbizbus.IndexPackage();
        }