For connecting the {@link #SERVICE_UP} sensor to the value of the
{@code getDriver().isRunning()} expression.
<p/>
Should be called inside {@link #connectSensors()}.

@see #disconnectServiceUpIsRunning()
490191
protected void connectServiceUpIsRunning() {
        serviceProcessIsRunning = FunctionFeed.builder()
                .entity(this)
                .period(Duration.FIVE_SECONDS)
                .poll(new FunctionPollConfig<Boolean, Boolean>(SERVICE_PROCESS_IS_RUNNING)
                        .onException(Functions.constant(Boolean.FALSE))
                        .callable(new Callable<Boolean>() {
                            public Boolean call() {
                                return getDriver().isRunning();
                            }
                        }))
                .build();
    }
49943
public static boolean isServiceRunning(Class<? extends Service> service) {
        ActivityManager manager = (ActivityManager) QuickUtils.getContext().getSystemService(Context.ACTIVITY_SERVICE);
        for (ActivityManager.RunningServiceInfo runningServiceInfo : manager.getRunningServices(Integer.MAX_VALUE)) {
            if (service.getName().equals(runningServiceInfo.service.getClassName())) {
                return true;
            }
        }
        return false;
    }
162926
@VisibleForTesting
    public ControllerServiceStarter awaitServicePausing() {
        monitor.enterWhenUninterruptibly(hasReachedPausing);
        try {
            if (serviceState != ServiceState.PAUSING) {
                throw new IllegalStateException("Expected state=" + ServiceState.PAUSING +
                        ", but actual state=" + serviceState);
            } else {
                return this.starter;
            }
        } finally {
            monitor.leave();
        }
    }
1357690
protected void unsetSslSupport(SSLSupport service) {
        sslSupport = null;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "unsetSslSupport", service);
        }
    }
1222480
@Override
	public Object getService(IServiceReference serviceReference) {
		final String sourceMethod = "getService"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(PlatformServicesImpl.class.getName(), sourceMethod, serviceReference);
		}
		Object result = null;
		BundleContext bundleContext = Activator.getBundleContext();
		if (bundleContext != null) {
			result = bundleContext
					.getService((ServiceReference<?>) serviceReference.getPlatformObject());
		}
		if (isTraceLogging) {
			log.exiting(PlatformServicesImpl.class.getName(), sourceMethod, result);
		}
		return result;
	}
1352044
private static boolean isRunningInWAS() {
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(TRACE, "isRunningInWAS");
        }

        if (inWAS == null) {
            inWAS = Boolean.TRUE;
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(TRACE, "isRunningInWAS", inWAS);
        }
        return inWAS.booleanValue();
    }
123700
protected boolean stopEchoService() {
    return Optional.ofNullable(getEchoService()).map(localEchoService -> {

      localEchoService.shutdown();

      try {
        if (!localEchoService.awaitTermination(30, TimeUnit.SECONDS)) {
          localEchoService.shutdownNow();

          if (!localEchoService.awaitTermination(30, TimeUnit.SECONDS)) {
            getLogger().warning("Failed to shutdown EchoService");
          }
        }
      }
      catch (InterruptedException ignore) {
        Thread.currentThread().interrupt();
      }

      return localEchoService.isShutdown();

    }).orElse(false);
  }
434126
private void autoStartConsumer() throws JMSException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "autoStartConsumer", new Object[] { autoStart, jmsConnection.getState() });

        try {
            //check if autoStart is true and connection is not started.
            //If its already started, it implies the first consumer has already started the connection
            if (autoStart && (jmsConnection.getState() == JmsInternalConstants.STOPPED)) {
                // start the connection
                jmsConnection.start();
            }
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "autoStartConsumer");
        }
    }
1331286
private Jedis getAndSetConnection()
    {
        Jedis conn = factory.getConnection();
        this.connection = conn;
        // If resource is not null means a transaction in progress.

        if (settings != null)
        {
            for (String key : settings.keySet())
            {
                conn.configSet(key, settings.get(key).toString());
            }
        }
        return conn;
    }
1233514
public static boolean isServiceRunning(Context context, Class<? extends Service> service) {
        return isServiceRunning(context, service, Integer.MAX_VALUE);
    }
1013430
public static void attachSignalHandler(final Runnable runnable) {
        Signal.handle(SIG_INT, new SignalHandler() {
            @Override
            public void handle(Signal signal) {
                runnable.run();
            }
        });
    }
652562
public final void shutdownNow() {

      if(isShuttingDown.compareAndSet(false, true)) {

         logInfo("Shutting down...");

         if(idleSegmentMonitorService != null) {
            logInfo("Shutting down idle segment monitor service...");
            idleSegmentMonitorService.shutdownNow();
         }

         if(segmentSignalQueue != null) {
            segmentSignalQueue.clear();
         }

         if(segmentSignalMonitorThread != null) {
            logInfo("Shutting down segment signal monitor thread...");
            segmentSignalMonitorThread.interrupt();
         }

         logInfo("Shutting down all segments...");
         for(ConnectionPoolSegment segment : segments) {
            segment.shutdownNow();
         }

         logInfo("Shutting down inactive monitor service...");
         inactiveMonitorService.shutdownNow();

         Clock.shutdown();

         logInfo("Shutdown complete!");
      }
   }
254591
public synchronized boolean isRunning() {
        if (null == process) return false;

        try {
            process.exitValue();
            return false;
        } catch(IllegalThreadStateException itse) {
            return true;
        }
    }
1031813
public boolean isRunning(final ProcessorGraphNode processorGraphNode) {
        this.processorLock.lock();
        try {
            return this.runningProcessors.containsKey(processorGraphNode.getProcessor());
        } finally {
            this.processorLock.unlock();
        }
    }
77690
@com.netflix.servo.annotations.Monitor(name = "isBelowRenewThreshold", description = "0 = false, 1 = true",
            type = com.netflix.servo.annotations.DataSourceType.GAUGE)
    @Override
    public int isBelowRenewThresold() {
        if ((getNumOfRenewsInLastMin() <= numberOfRenewsPerMinThreshold)
                &&
                ((this.startupTime > 0) && (System.currentTimeMillis() > this.startupTime + (serverConfig.getWaitTimeInMsWhenSyncEmpty())))) {
            return 1;
        } else {
            return 0;
        }
    }
836571
public static boolean isStandaloneRunning(final ModelControllerClient client) {
        try {
            final ModelNode response = client.execute(Operations.createReadAttributeOperation(EMPTY_ADDRESS, "server-state"));
            if (Operations.isSuccessfulOutcome(response)) {
                final String state = Operations.readResult(response).asString();
                return !CONTROLLER_PROCESS_STATE_STARTING.equals(state)
                        && !CONTROLLER_PROCESS_STATE_STOPPING.equals(state);
            }
        } catch (RuntimeException | IOException e) {
            LOGGER.trace("Interrupted determining if standalone is running", e);
        }
        return false;
    }
507508
private boolean awaitRunning(Service service, long timeoutAt) {
        if (service.isRunning()) {
            return true;
        }
        long waitMillis = timeoutAt - System.currentTimeMillis();
        if (waitMillis <= 0) {
            return false;
        }
        try {
            service.start().get(waitMillis, TimeUnit.MILLISECONDS);
        } catch (Exception e) {
            // Fall through
        }
        return service.isRunning();
    }