Return true if the given service is ready to be used,
means initialized and running.

@param serviceClass
@return isReady
14783
public boolean isReady(final Class serviceClass) {

                Service service = serviceCache.get(serviceClass);
                return (service != null && service.isRunning());
	}
98510
public <T extends View> boolean waitForView(final Class<T> viewClass){
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "waitForView("+viewClass+")");
		}
		
		return waiter.waitForView(viewClass, 0, Timeout.getLargeTimeout(), true);
	}
573278
public static <T> void register(final Class<T> service) {
        for (T each : ServiceLoader.load(service)) {
            registerServiceClass(service, each);
        }
    }
770513
public static boolean checkService(Context context, Class<?> service) {
    try {
      ServiceInfo info = context.getPackageManager().getServiceInfo(
          new ComponentName(context, service), 0);
      return null != info;
    } catch (PackageManager.NameNotFoundException e) {
      printErrorLog("service " + service.getName() + " is missing!");
      return false;
    }
  }
1167887
protected void setReady(boolean ready) {
        synchronized (SERVICE_AVILABILITY_LOCK) {
            LOG.info("Service {} is now {}", getName(), ready ? "READY" : "NOT READY");
            this.ready = ready;
            checkAvailability();
        }
        runAvailableMethod(); // call outside lock
    }
866551
private boolean initPropertyService() {
        if (propertyService == null && appContext.containsBean("propertyService")) {
            propertyService = appContext.getBean("propertyService", IPropertyService.class);
        }
        
        return propertyService != null;
    }
863337
public static <T> Collection<T> loadEnriched(final Class<T> serviceClass)
   {
      try
      {
         Collection<T> services = new ArrayList<T>();
         ServiceEnricher origin = null;

         if (!NonEnriching.class.isAssignableFrom(serviceClass))
         {
            if (enricherLoader == null)
            {
               enricherLoader = java.util.ServiceLoader
                        .load(ServiceEnricher.class);
            }

            for (ServiceEnricher enricher : enricherLoader)
            {
               services = enricher.produce(serviceClass);
               if (services == null)
               {
                  services = new ArrayList<T>();
               }
               if (!services.isEmpty())
               {
                  origin = enricher;
                  break;
               }
            }
         }

         if (services.isEmpty())
         {
            Constructor<? extends T> constructor = serviceClass.getDeclaredConstructor();
            constructor.setAccessible(true);
            services.add(constructor.newInstance());
         }

         if (!NonEnriching.class.isAssignableFrom(serviceClass))
         {
            for (ServiceEnricher enricher : enricherLoader)
            {
               if (!enricher.equals(origin))
               {
                  for (T service : services) {
                     enricher.enrich(service);
                  }
               }
            }
         }

         return services;
      }
      catch (NoClassDefFoundError e)
      {
         throw new RuntimeException("Could not instantiate service class " + serviceClass.getName(), e);
      }
      catch (InvocationTargetException e)
      {
         throw new RuntimeException("Error instantiating " + serviceClass, e.getCause());
      }
      catch (IllegalArgumentException e)
      {
         throw new RuntimeException("Error instantiating " + serviceClass, e);
      }
      catch (InstantiationException e)
      {
         throw new RuntimeException("Error instantiating " + serviceClass, e);
      }
      catch (IllegalAccessException e)
      {
         throw new RuntimeException("Error instantiating " + serviceClass, e);
      }
      catch (SecurityException e)
      {
         throw new RuntimeException("Error instantiating " + serviceClass, e);
      }
      catch (NoSuchMethodException e)
      {
         throw new RuntimeException("Error instantiating " + serviceClass, e);
      }
   }
809822
private <T extends OrchidService> void initializeService(Class<T> serviceClass, T service) {
        services.put(serviceClass, service);
    }
642058
def is_ready(instance, pending=False):
    

    last_reload = lookup(instance, 'lastOperatingSystemReload', 'id')
    active_transaction = lookup(instance, 'activeTransaction', 'id')

    reloading = all((
        active_transaction,
        last_reload,
        last_reload == active_transaction,
    ))
    outstanding = False
    if pending:
        outstanding = active_transaction
    if instance.get('provisionDate') and not reloading and not outstanding:
        return True
    return False
1368507
@Override
    public boolean isReady() {

        if(this.isOutputStreamNBClosed()){
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){  
                Tr.debug(tc, "output stream closed, ready->" + false);
            }
            return false;
        }
        return this.isWriteReadyWork(true);
    }
1233514
public static boolean isServiceRunning(Context context, Class<? extends Service> service) {
        return isServiceRunning(context, service, Integer.MAX_VALUE);
    }
443851
private <T> List<T> loadServices(final Class<T> serviceType) {
        List<T> services = new ArrayList<>();
        try {
            for (T t : ServiceLoader.load(serviceType)) {
                services.add(t);
            }
            services.sort(Comparator.comparing(o -> o.getClass().getSimpleName()));
            @SuppressWarnings("unchecked")
            final List<T> previousServices = (List<T>) servicesLoaded.putIfAbsent(serviceType, (List<Object>) services);
            return Collections.unmodifiableList(previousServices != null ? previousServices : services);
        } catch (Exception e) {
            Logger.getLogger(DefaultServiceProvider.class.getName()).log(Level.WARNING,
                                                                         "Error loading services of type " + serviceType, e);
            return services;
        }
    }
63849
public static Object waitForServiceStartup(BundleContext context, String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String, String> filter, int secsToWait)
    {
        if (interfaceClassName == null)
            interfaceClassName = serviceClassName;
        ServiceReference ref = BaseClassFinderService.getClassServiceReference(context, interfaceClassName, versionRange, filter);
        if (ref != null)
        {   // Good, it's registered - make sure it's started, or just start it!
            if (ClassFinderActivator.waitForBundleStartup(context, ref.getBundle(), secsToWait))
                return ref.getBundle().getBundleContext().getService(ref);
            else
                return null;    // Never
        }
        
        Bundle bundle = BaseClassFinderService.findBundle(context, ClassFinderActivator.getPackageName(serviceClassName, false), versionRange);
        if (bundle == null)
            if (serviceClassName != null)
                if (!serviceClassName.equals(ClassFinder.class.getName())) // Never. This code is in this bundle.
        {
            ClassFinder classFinder = getClassFinder(context, secsToWait);        
            String packageName = ClassFinderActivator.getPackageName(serviceClassName, false);
            Object resource = classFinder.deployThisResource(packageName, versionRange, true);  // Get the bundle info from the repos
            bundle = (Bundle)classFinder.findBundle(resource, context, packageName, versionRange);
        }
        if (bundle == null)
            return null;    // Error, can't find bundle
        
        Thread thread = Thread.currentThread();
        ServiceRegisteredListener classFinderListener = null;
        try {
            context.addServiceListener(classFinderListener = new ServiceRegisteredListener(thread, bundleContext), "(" + Constants.OBJECTCLASS + "=" + interfaceClassName + ")");
        } catch (InvalidSyntaxException e) {
            e.printStackTrace();
        }
        if (!ClassFinderActivator.waitForBundleStartup(context, bundle, secsToWait))
            return null;
        // Double-check to make sure it didn't startup while I was doing all this.
        Object bundleService = getClassFinder(context, secsToWait).getClassBundleService(interfaceClassName, serviceClassName, versionRange, filter, 0);
        if (bundleService == null)
        { // 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.removeServiceListener(classFinderListener);
        
        ref = BaseClassFinderService.getClassServiceReference(context, interfaceClassName, versionRange, filter);
        if (ref == null)
        {
            ClassServiceUtility.log(context, LogService.LOG_WARNING, "The " + interfaceClassName + " service was never registered - make sure you start it!");
            return null;
        }
        return ref.getBundle().getBundleContext().getService(ref);
    }
1180742
private boolean hasNextSafely(Iterator iterator) {
        try {
            /* Throw a ServiceConfigurationError if a provider-configuration file violates the specified format,
+            or if it names a provider class that cannot be found and instantiated, or if the result of
+            instantiating the class is not assignable to the service type, or if any other kind of exception
+            or error is thrown as the next provider is located and instantiated.
+            @see http://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html#iterator()
+            */
            return iterator.hasNext();
        } catch (Exception e) {
            LOGGER.error("iterator.hasNext() failed", e);
            return false;
        }
    }
910089
private boolean checkFailover() throws InterruptedException {
    boolean isPrimary = isPrimaryServiceCached();
    if (!isPrimary && isPrimaryService()) {
      this.servicePair.setPrimaryOfferService(this);
      return true;
    }
    return false;
  }
1321348
boolean isReady() {
        final C[] ds = destinations.get();
        if (ds == null)
            return false;
        for (final C d : ds)
            if (d == null)
                return false;
        final boolean ret = ds.length != 0; // this method is only called in tests and this needs to be true there.

        if (ret && LOGGER.isDebugEnabled())
            LOGGER.debug("at {} to {} is Ready " + shorthand(ds), thisNodeId, groupName);

        return ret;
    }
396830
@Override
    public List<ServiceInfo> getServiceInfos(Class serviceClass) {
        final LinkedList<ServiceInfo> result = new LinkedList<ServiceInfo>();
        for (ServiceInfo serviceInfo : services.values()) {
            if (serviceInfo.isInstanceOf(serviceClass)) {
                if (serviceInfo.isCoreService()) {
                    result.addFirst(serviceInfo);
                } else {
                    result.addLast(serviceInfo);
                }
            }
        }
        return result;
    }