示例#1
0
        /// <summary>
        /// 停止
        /// </summary>
        public void Stop()
        {
            log.Debug(string.Format("模块{0}停止开始!", this.GetBundleAssemblyFileName()));

            if (this.state == BundleStateConst.ACTIVE)
            {
                this.state = BundleStateConst.STOPPING;
                if (bundleActivator != null)
                {
                    var frameworkFireEvent = (IFrameworkFireEvent)framework;
                    frameworkFireEvent.FireBundleEvent(new BundleEventArgs(BundleEventArgs.STOPPING, this));

                    log.Debug("卸载扩展点数据!");
                    UnLoadExtensions();

                    log.Debug("激活器停止");
                    bundleActivator.Stop(bundleContext);

                    ((BundleContext)bundleContext).Stop();

                    frameworkFireEvent.FireBundleEvent(new BundleEventArgs(BundleEventArgs.STOPPED, this));

                    bundleActivator = null;
                }
                this.state = BundleStateConst.RESOLVED;
            }

            log.Debug(string.Format("模块{0}停止结束!", this.GetBundleAssemblyFileName()));
        }
示例#2
0
 /// <summary>
 /// 停止激活器
 /// </summary>
 public void Stop()
 {
     try
     {
         if (activator != null)
         {
             activator.Stop(this);
         }
     }
     catch (Exception ex)
     {
         string clazz = null;
         clazz = activator.GetType().FullName;
         throw new BundleException(string.Format("Activator Start Exception. [Clazz:{0}] - [Method:{1}] -[Bundle:{2}] ", new object[] { clazz, "Stop", string.IsNullOrEmpty(bundle.SymbolicName) ? "" + bundle.BundleId : bundle.SymbolicName }), ex, BundleExceptionType.ACTIVATOR_ERROR); //$NON-NLS-1$ //$NON-NLS-2$
     }
     finally
     {
         activator = null;
     }
 }
示例#3
0
        public void Stop()
        {
            try
            {
                this.state = BundleState.Stopping;
                IBundleActivator activator = this.Activator;
                if (activator == null)
                {
                    throw new Exception("No activator for: " + this.Location);
                }

                activator.Stop(this.Context);
            }
            catch (Exception e)
            {
                TracesProvider.TracesOutput.OutputTrace(e.Message);
                throw new BundleException(e.Message, e);
            }

            this.state = BundleState.Installed;
        }
示例#4
0
        public void Stop()
        {
            try
            {
                this.state = BundleState.Stopping;
                IBundleActivator activator = this.Activator;
                if (activator == null)
                {
                    throw new Exception("No activator for: " + this.Location);
                }

                activator.Stop(this.Context);
            }
            catch (Exception e)
            {
                TracesProvider.TracesOutput.OutputTrace(e.Message);
                throw new BundleException(e.Message, e);
            }

            this.state = BundleState.Installed;
            EventManager.OnBundleChanged(new BundleEventArgs(BundleTransition.Stopped, this));
        }