def start(self):
        # type: () -> bool
        """
        Starts the framework

        :return: True if the bundle has been started, False if it was already
                 running
        :raise BundleException: A bundle failed to start
        """
        with self._lock:
            if self._state in (Bundle.STARTING, Bundle.ACTIVE):
                # Already started framework
                return False

            # Reset the stop event
            self._fw_stop_event.clear()

            # Starting...
            self._state = Bundle.STARTING
            self._dispatcher.fire_bundle_event(
                BundleEvent(BundleEvent.STARTING, self)
            )

            # Start all registered bundles (use a copy, just in case...)
            for bundle in self.__bundles.copy().values():
                try:
                    bundle.start()
                except FrameworkException as ex:
                    # Important error
                    _logger.exception(
                        "Important error starting bundle: %s", bundle
                    )
                    if ex.needs_stop:
                        # Stop the framework (has to be in active state)
                        self._state = Bundle.ACTIVE
                        self.stop()
                        return False
                except BundleException:
                    # A bundle failed to start : just log
                    _logger.exception("Error starting bundle: %s", bundle)

            # Bundle is now active
            self._state = Bundle.ACTIVE
            return True
def start ( self ) : with self . _lock : if self . _state in ( Bundle . STARTING , Bundle . ACTIVE ) : return False self . _fw_stop_event . clear ( ) self . _state = Bundle . STARTING self . _dispatcher . fire_bundle_event ( BundleEvent ( BundleEvent . STARTING , self ) ) for bundle in self . __bundles . copy ( ) . values ( ) : try : bundle . start ( ) except FrameworkException as ex : _logger . exception ( "Important error starting bundle: %s" , bundle ) if ex . needs_stop : self . _state = Bundle . ACTIVE self . stop ( ) return False except BundleException : _logger . exception ( "Error starting bundle: %s" , bundle ) self . _state = Bundle . ACTIVE return True
Starts the framework

        :return: True if the bundle has been started, False if it was already
                 running
        :raise BundleException: A bundle failed to start