code: public static boolean waitForBundleStartup(BundleContext context, Bundle bundle, int secsToWait)
      {
          if ((bundle.getState() & Bundle.ACTIVE) == 0)
          { // Wait for it to start up!
              if (((bundle.getState() & Bundle.RESOLVED) != 0) || ((bundle.getState() & Bundle.INSTALLED) != 0))
              {
                  try {
                      bundle.start();
                  } catch (BundleException e) {
                      e.printStackTrace();
                  }
              }
              if ((bundle.getState() & Bundle.ACTIVE) == 0)
              { // Wait for it to start up!
                  Thread thread = Thread.currentThread();
                  BundleStartupListener bundleStartupListener = null;
                  context.addBundleListener(bundleStartupListener = new BundleStartupListener(thread, bundleContext, bundle));
                  // Wait 15 seconds for the ClassService to come up while the activator starts this service
                  synchronized (thread) {
                      try {
                          thread.wait((secsToWait == -1) ? DEFAULT_SERVICE_WAIT_SECS * 1000 : secsToWait * 1000);    // Will notify me when it is up
                      } catch (InterruptedException ex) {
                          ex.printStackTrace();
                      }
                  }
                  context.removeBundleListener(bundleStartupListener);
              }
          }
          
          return ((bundle.getState() & Bundle.ACTIVE) != 0);
      }
docs: Wait for bundle class name.
  @param context
  @param bundleClassName
  @return