Stops and starts the framework, if the framework is active.

        :raise BundleException: Something wrong occurred while stopping or
                                starting the framework.
335394
def update(self):
        
        with self._lock:
            if self._state == Bundle.ACTIVE:
                self.stop()
                self.start()
548707
@Override
    public void start(BundleContext bc) throws Exception {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "start", bc);
        }
    }
765706
@Override
    protected void onStop()
    {
        m_context.removeBundleListener( m_bundleListener );
        final Bundle[] toBeRemoved =
            m_mappings.keySet().toArray( new Bundle[m_mappings.keySet().size()] );
        for( Bundle bundle : toBeRemoved )
        {
            unregister( bundle );
        }

        m_bundleListener = null;
        m_mappings = null;
    }
859834
def stop(self):
        
        if self._state != Bundle.ACTIVE:
            # Invalid state
            return

        exception = None
        with self._lock:
            # Store the bundle current state
            previous_state = self._state

            # Stopping...
            self._state = Bundle.STOPPING
            self._fire_bundle_event(BundleEvent.STOPPING)

            # Call the activator, if any
            stopper = self.__get_activator_method("stop")
            if stopper is not None:
                try:
                    # Call the start method
                    stopper(self.__context)
                except (FrameworkException, BundleException) as ex:
                    # Restore previous state
                    self._state = previous_state

                    # Re-raise directly Pelix exceptions
                    _logger.exception(
                        "Pelix error raised by %s while stopping", self.__name
                    )
                    exception = ex
                except Exception as ex:
                    _logger.exception(
                        "Error raised by %s while stopping", self.__name
                    )
                    # Store the exception (raised after service clean up)
                    exception = BundleException(ex)

            # Hide remaining services
            self.__framework._hide_bundle_services(self)

            # Intermediate bundle event : activator should have cleaned up
            # everything, but some element could stay (iPOPO components, ...)
            self._fire_bundle_event(BundleEvent.STOPPING_PRECLEAN)

            # Remove remaining services (the hard way)
            self.__unregister_services()

            # Cleanup service usages
            self.__framework._unget_used_services(self)

            # Bundle is now stopped and all its services have been unregistered
            self._state = Bundle.RESOLVED
            self._fire_bundle_event(BundleEvent.STOPPED)

        # Raise the exception, if any
        # pylint: disable=E0702
        # Pylint seems to miss the "is not None" check below
        if exception is not None:
            raise exception
1204976
def uninstall(self):
        
        with self._lock:
            if self._state == Bundle.ACTIVE:
                self.stop()

            # Change the bundle state
            self._state = Bundle.UNINSTALLED

            # Call the framework
            self.__framework.uninstall_bundle(self)
588943
public void start() throws Exception {
        baseFilterFactory = new DefaultFilterFactory(bundleContext, filterClass, priority, applicationName, initParams);
        baseFilterFactory.register();
    }
230534
public final boolean start() {

        if (running || booting || stopping || terminated) {
            // do nothing if this instance is not stopped
            return false;
        } else {
            // mark this instance started
            booting = true;
            running = true;

            onStarted();

            return true;
        }
    }
1237447
def safe_callback(self, event, *args, **kwargs):
        # type: (str, *Any, **Any) -> Any
        
        if self.state == StoredInstance.KILLED:
            # Invalid state
            return None

        try:
            return self.__callback(event, *args, **kwargs)
        except FrameworkException as ex:
            # Important error
            self._logger.exception(
                "Critical error calling back %s: %s", self.name, ex
            )

            # Kill the component
            self._ipopo_service.kill(self.name)

            if ex.needs_stop:
                # Framework must be stopped...
                self._logger.error(
                    "%s said that the Framework must be stopped.", self.name
                )
                self.bundle_context.get_framework().stop()
            return False
        except:
            self._logger.exception(
                "Component '%s': error calling callback method for event %s",
                self.name,
                event,
            )
            return False
564758
public void waitForBundlesActivation(CloseableHttpClient httpClient) {
    if (StringUtils.isBlank(props.getBundleStatusUrl())) {
      log.debug("Skipping check for bundle activation state because no bundleStatusURL is defined.");
      return;
    }

    final int WAIT_INTERVAL_SEC = 3;
    final long CHECK_RETRY_COUNT = props.getBundleStatusWaitLimitSec() / WAIT_INTERVAL_SEC;

    log.info("Check bundle activation status...");
    for (int i = 1; i <= CHECK_RETRY_COUNT; i++) {
      BundleStatusCall call = new BundleStatusCall(httpClient, props.getBundleStatusUrl(), log);
      BundleStatus bundleStatus = executeHttpCallWithRetry(call, 0);

      boolean instanceReady = true;

      // check if bundles are still stopping/staring
      if (!bundleStatus.isAllBundlesRunning()) {
        log.info("Bundles starting/stopping: " + bundleStatus.getStatusLineCompact()
            + " - wait " + WAIT_INTERVAL_SEC + " sec "
            + "(max. " + props.getBundleStatusWaitLimitSec() + " sec) ...");
        sleep(WAIT_INTERVAL_SEC);
        instanceReady = false;
      }

      // check if any of the blacklisted bundles is still present
      if (instanceReady) {
        for (Pattern blacklistBundleNamePattern : props.getBundleStatusBlacklistBundleNames()) {
          String bundleSymbolicName = bundleStatus.getMatchingBundle(blacklistBundleNamePattern);
          if (bundleSymbolicName != null) {
            log.info("Bundle '" + bundleSymbolicName + "' is still deployed "
                + " - wait " + WAIT_INTERVAL_SEC + " sec "
                + "(max. " + props.getBundleStatusWaitLimitSec() + " sec) ...");
            sleep(WAIT_INTERVAL_SEC);
            instanceReady = false;
            break;
          }
        }
      }

      // instance is ready
      if (instanceReady) {
        break;
      }
    }
  }
962580
async def start(self):
        

        successful = 0

        try:
            for adapter in self.adapters:
                await adapter.start()
                successful += 1

            self._started = True
        except:
            for adapter in self.adapters[:successful]:
                await adapter.stop()

            raise
435341
def run(self):
        
        while True:
            try:
                self._callback(self.wait_read_frame())
            except ThreadQuitException:
                # Expected termintation of thread due to self.halt()
                break
            except Exception as e:
                # Unexpected thread quit.
                if self._error_callback:
                    self._error_callback(e)
78527
@Override
	public void run() {
		// Flag to avoid checking the very first time, when the request handler
		// has just started.
		boolean firstRun = true;

		while (continuePolling) {
			try {
				// Must check before sleeping, otherwise stopPolling does not
				// work.
				if (!firstRun) {
					if (propertiesSource.configChanged()) {
						Properties props = propertiesSource.getConfigProperties();
						if (overriddenProperties != null) {
							props.putAll(overriddenProperties);
						}
						listener.configChanged(props);
					} else if (bundlesHandler != null && bundlesHandler.bundlesNeedToBeRebuild()) {
						listener.rebuildDirtyBundles();
					}
				}
				sleep(waitMillis);
				firstRun = false;

			} catch (InterruptedException e) {
				// Nothing to do
			} catch (InterruptBundlingProcessException e) {
				if (LOGGER.isInfoEnabled()) {
					LOGGER.info("Bundling processed stopped");
				}
			}
		}
		
		this.bundlesHandler = null;
		this.listener = null;
	}
432989
def delete(self, force=False):
        
        if not force and self._state not in (
            Bundle.INSTALLED,
            Bundle.RESOLVED,
            Bundle.STOPPING,
        ):
            _logger.warning("Trying to delete an active framework")
            return False

        return FrameworkFactory.delete_framework(self)
505484
def start(self):
        
        self.recieve('APP_START')
        self.alive = True
        while self.alive:
            message, payload = self.messages.get()
            if message == 'APP_STOP':
                for plugin in self.plugins:
                    plugin.recieve('SHUTDOWN')
                self.alive = False
            else:
                self.recieve(message, payload)
1334852
@Override
    public void bundleChanged(BundleEvent event) {
        // We *only* react to the STOPPING event for the system bundle (bundle 0).
        if (event.getBundle().getBundleId() == 0 && event.getType() == BundleEvent.STOPPING) {
            ServiceReference<ForcedServerStop> forcedStop = bundleCtx.getServiceReference(ForcedServerStop.class);

            if (forcedStop != null) {
                // ABRUPT STOP (no quiesce stage)
                // This will make NotificationImpl#waitForCompletion stop looping
                normalServerStop.set(false);
            } else {
                // NICE / NORMAL STOP
                // Find all ServerQueisceListeners and notify them
                try {
                    quiesceListeners(bundleCtx.getServiceReferences(ServerQuiesceListener.class, null));
                } catch (InvalidSyntaxException e) {
                    // not going to happen with a null filter.
                }
            }
        }
    }
259599
def stop(self):
        '''  '''
        Global.LOGGER.debug(f"action {self.name} stopped")
        self.is_running = False
        self.on_stop()
1057530
def start(self, initial_delay=0):
        
        if self.listener is None:
            raise exceptions.NoAsyncListenerError
        elif self._enabled:
            return

        self._enabled = True