protected override void DoStop(BundleStopOptions option) { if (((base.State != BundleState.Starting) && (base.State != BundleState.Stopping)) && base.IsActive) { base.State = BundleState.Stopping; IBundleContext context = base.Context; Exception exception = null; try { if (this.Activator != null) { this.Activator.Stop(context); } } catch (Exception exception2) { FileLogUtility.Error(string.Format(Messages.ExceptionOccursWhenStopping, base.SymbolicName, base.Version)); FileLogUtility.Error(exception2); exception = exception2; } this.CheckValidState(); base.State = BundleState.Resolved; if (option == BundleStopOptions.General) { this.SavePersistent(); } base.Context.Dispose(); base.Context = null; if (exception != null) { throw exception; } } }
public void Stop(string bundleSymbolicName, BundleStopOptions option) { IBundle bundleBySymbolicName = Framework.GetBundleBySymbolicName(bundleSymbolicName); if (bundleBySymbolicName != null) { bundleBySymbolicName.Stop(option); } }
public override void Stop(BundleStopOptions option) { if (base.State == BundleState.Active) { new Thread(delegate { Stopwatch stopwatch = new Stopwatch(); try { stopwatch.Start(); base.Framework.Stop(); } finally { stopwatch.Stop(); FileLogUtility.Verbose(string.Format(Messages.StopSystemBundleTimeCounter, stopwatch.ElapsedMilliseconds)); } }).Start(); } }
protected override void DoStop(BundleStopOptions option) { int startLevel; if (base.State == BundleState.Active) { base.State = BundleState.Stopping; startLevel = base.Framework.StartLevelManager.StartLevel; List <IBundle> list = base.Framework.Bundles.FindAll(bundle => bundle.GetBunldeStartLevel() <= startLevel); list.Sort((bundle1, bundle2) => bundle2.GetBunldeStartLevel().CompareTo(bundle1.GetBunldeStartLevel())); int num = 0; while (true) { if (num >= list.Count) { break; } HostBundle bundle = list[num] as HostBundle; if (bundle != null) { try { list[num].Stop(BundleStopOptions.Transient); base.Framework.EventManager.DispatchFrameworkEvent(this, new FrameworkEventArgs(FrameworkEventType.Stopped, list[num])); } catch (Exception exception) { FileLogUtility.Error(string.Format(Messages.StopBundleFailed, bundle.SymbolicName, bundle.Version)); FileLogUtility.Error(exception); base.Framework.EventManager.DispatchFrameworkEvent(this, new FrameworkEventArgs(FrameworkEventType.Error, list[num], exception)); } } num++; } base.State = BundleState.Resolved; } }
protected override void DoStop(BundleStopOptions option) { throw new BundleException(Messages.FragmentBundleCanNotBeStopped); }
public virtual void Stop(BundleStopOptions option) { FileLogUtility.Debug(string.Format(Messages.BundleStopping, SymbolicName, Version)); DoLifecycleAction(() => DoStop(option), Messages.StopAction); FileLogUtility.Debug(string.Format(Messages.BundleInState, SymbolicName, Version, State)); }
protected abstract void DoStop(BundleStopOptions option);