code: @Override
      public void frameworkEvent(FrameworkEvent event) {
          switch (event.getType()) {
              case FrameworkEvent.ERROR:
                  status.addStartException(event.getBundle(), event.getThrowable());
                  break;
  
              // Wake up the listener when packages refreshed event occurs, 
              // or the framework is stopped...
              case FrameworkEvent.STOPPED:
              case FrameworkEvent.STOPPED_UPDATE:
              case FrameworkEvent.PACKAGES_REFRESHED:
                  finish(false);
                  break;
              default:
                  break;
          }
      }
docs: Listen to framework events until we get a STARTLEVEL_CHANGED
  event, at which time we stop listening for framework events,
  and notify the waiting thread that a startlevel operation
  has finished (it could, in theory, be someone else's startlevel
  operation...).