code: protected BundleStartStatus setFrameworkStartLevel(int level) {
          BundleStartStatus startStatus = null;
  
          if (frameworkStartLevel != null) {
              // The framework listener passed as a paramter will be notified with a
              // FrameworkEvent (START_LEVEL_CHANGED or ERROR) when the setStartLevel
              // operation completes.
              StartLevelFrameworkListener slfw = new StartLevelFrameworkListener(true);
              frameworkStartLevel.setStartLevel(level, slfw);
              slfw.waitForLevel();
              startStatus = slfw.getStatus();
          } else
              startStatus = new BundleStartStatus();
  
          return startStatus;
      }
docs: Set the start level of the framework, and listen for framework events to
  ensure we wait until the start level operation is complete before
  continuing (due to timing, this translates into waiting until the next
  start level event is fired.. we don't necessarily know that it's ours..).
  
  @param level
  StartLevel to change to
  @return BundleStartStatus containing any exceptions encountered during
  the StartLevel change operation.