コード例 #1
0
ファイル: BundleHost.cs プロジェクト: zhaoyin/officeOBA
        /// <summary>
        /// 获取类加载器
        /// </summary>
        /// <returns></returns>
        public IClassLoader GetClassLoader()
        {
            BundleLoaderProxy curProxy = GetLoaderProxy();
            IBundleLoader     loader   = curProxy == null ? null : curProxy.BundleLoader;
            IClassLoader      bcl      = loader == null ? null : curProxy.CreateBundleLoader();

            return(bcl);
        }
コード例 #2
0
ファイル: BundleHost.cs プロジェクト: zhaoyin/officeOBA
 /// <summary>
 /// 获取加载器代理
 /// </summary>
 /// <returns></returns>
 public BundleLoaderProxy GetLoaderProxy()
 {
     if (proxy != null)
     {
         return(proxy);
     }
     proxy = new BundleLoaderProxy(this);
     return(proxy);
 }
コード例 #3
0
ファイル: AbstractBundle.cs プロジェクト: yshulin/OSGi
        public virtual object LoadResource(string resourceName, ResourceLoadMode loadMode)
        {
            object    obj2;
            Stopwatch stopwatch = new Stopwatch();

            try
            {
                stopwatch.Start();
                obj2 = BundleLoaderProxy.LoadResource(resourceName, loadMode);
            }
            finally
            {
                stopwatch.Stop();
                FileLogUtility.Verbose(string.Format(Messages.LoadResourceTimeCounter, new object[] { stopwatch.ElapsedMilliseconds, resourceName, SymbolicName, Version }));
            }
            return(obj2);
        }
コード例 #4
0
ファイル: AbstractBundle.cs プロジェクト: yshulin/OSGi
        public virtual Type LoadClass(string className)
        {
            Type      type;
            Stopwatch stopwatch = new Stopwatch();

            try
            {
                stopwatch.Start();
                type = BundleLoaderProxy.LoadClass(className);
            }
            finally
            {
                stopwatch.Stop();
                FileLogUtility.Verbose(string.Format(Messages.LoadClassTimeCounter, new object[] { stopwatch.ElapsedMilliseconds, className, SymbolicName, Version }));
            }
            return(type);
        }
コード例 #5
0
ファイル: AbstractBundle.cs プロジェクト: yshulin/OSGi
        public AbstractBundle(BundleData bundleData, Framework framework)
        {
            if (framework == null)
            {
                throw new ArgumentNullException();
            }
            _stateChangingLock           = new object();
            _stateChangingAutoResetEvent = new AutoResetEvent(false);
            BundleData = bundleData;
            Framework  = framework;
            _state     = BundleState.Installed;
            if (bundleData != null)
            {
                SymbolicName = bundleData.SymbolicName;
            }
            var proxy = new BundleLoaderProxy(this)
            {
                Framework = framework
            };

            BundleLoaderProxy = proxy;
            BundleType        = string.IsNullOrEmpty(bundleData.HostBundleSymbolicName) ? BundleType.Host : BundleType.Fragment;
        }
コード例 #6
0
ファイル: BundleHost.cs プロジェクト: zhaoyin/officeOBA
        protected IBundleLoader GetBundleLoader()
        {
            BundleLoaderProxy curProxy = GetLoaderProxy();

            return(curProxy == null ? null : curProxy.BundleLoader);
        }
コード例 #7
0
ファイル: BundleHost.cs プロジェクト: zhaoyin/officeOBA
 /// <summary>
 /// 加载插件
 /// </summary>
 internal override void Load()
 {
     proxy = null;
 }