code: def start(self):
          
          if self.__framework._state not in (Bundle.STARTING, Bundle.ACTIVE):
              # Framework is not running
              raise BundleException(
                  "Framework must be started before its bundles"
              )
  
          with self._lock:
              if self._state in (Bundle.ACTIVE, Bundle.STARTING):
                  # Already started bundle, do nothing
                  return
  
              # Store the bundle current state
              previous_state = self._state
  
              # Starting...
              self._state = Bundle.STARTING
              self._fire_bundle_event(BundleEvent.STARTING)
  
              # Call the activator, if any
              starter = self.__get_activator_method("start")
              if starter is not None:
                  try:
                      # Call the start method
                      starter(self.__context)
                  except (FrameworkException, BundleException):
                      # Restore previous state
                      self._state = previous_state
  
                      # Re-raise directly Pelix exceptions
                      _logger.exception(
                          "Pelix error raised by %s while starting", self.__name
                      )
                      raise
                  except Exception as ex:
                      # Restore previous state
                      self._state = previous_state
  
                      # Raise the error
                      _logger.exception(
                          "Error raised by %s while starting", self.__name
                      )
                      raise BundleException(ex)
  
              # Bundle is now active
              self._state = Bundle.ACTIVE
              self._fire_bundle_event(BundleEvent.STARTED)
docs: Starts the bundle. Does nothing if the bundle is already starting or
          active.
  
          :raise BundleException: The framework is not yet started or the bundle
                                  activator failed.