Stop an instance
@param home The home directory
@return The exit code
11078
public int stop(String home)
   {
      Process p = instances.get(home);
      if (p != null)
      {
         try
         {
            p.destroy();
            return p.exitValue();

         }
         catch (Throwable t)
         {
            return -1;
         }
         finally
         {
            instances.remove(home);
         }
      }

      return 0;
   }
1298243
private Action0 stopTracing(final Span parent) {
        return new Action0() {
            @Override
            public void call() {
                if (parent != null) {
                    environment.tracer().scopeManager()
                        .activate(parent, true)
                        .close();
                }
            }
        };
    }
1223192
@Override
  public boolean stop()
  {
    if (! _lifecycle.toStopping())
      return false;

    log.finest(this + " stopping");

    closeConnections();

    destroy();

    return true;
  }
630500
@Write(consumes = {})
    public Object stop() {
        try {
            return message;
        } finally {
            Thread thread = new Thread(this::stopServer);
            thread.setContextClassLoader(getClass().getClassLoader());
            thread.start();
        }
    }
806352
@Invalidate
    public void stop() {
        unregisterConfigurationsExposedAsServices();
        if (registration != null) {
            registration.unregister();
            registration = null;
            try {
                watcher.removeAndStopIfNeeded(configFile.getParentFile());
            } catch (RuntimeException e) { //NOSONAR
                // An exception can be thrown when the platform is shutting down.
                // ignore it.
            }
        }
    }
525008
function stopRelay(cb) {
        var self = this;

        if (!this.control && !this.process) {
            return cb();
        }

        this.control.signalShutdown(function (err) {
            if (err) {
                return cb(err);
            }
            self.process.on('exit', function () {
                /**
                 * @callback TorRelay~stopCallback
                 * @param {null| error} error - Error if there was one
                 */
                return cb();
            });
        });
        return this;
    }
276220
public void stop(StopConfiguration configuration) throws AppEngineException {
    Preconditions.checkNotNull(configuration);
    HttpURLConnection connection = null;
    String host = configuration.getHost() != null ? configuration.getHost() : DEFAULT_HOST;
    int port = configuration.getPort() != null ? configuration.getPort() : DEFAULT_PORT;
    URL adminServerUrl = null;
    try {
      adminServerUrl = new URL("http", host, port, "/_ah/admin/quit");
      connection = (HttpURLConnection) adminServerUrl.openConnection();
      connection.setDoOutput(true);
      connection.setDoInput(true);
      connection.setRequestMethod("POST");
      connection.getOutputStream().write('\n');
      connection.disconnect();
      int responseCode = connection.getResponseCode();
      if (responseCode < 200 || responseCode > 299) {
        throw new AppEngineException(
            adminServerUrl + " responded with " + connection.getResponseMessage() + ".");
      }
    } catch (IOException ex) {
      throw new AppEngineException("Error connecting to " + adminServerUrl, ex);
    } finally {
      if (connection != null) {
        try {
          connection.getInputStream().close();
        } catch (IOException ignore) {
          // ignored
        }
      }
    }
  }
1077851
@Override
    public synchronized void stop(final StopContext context) {
        final boolean shutdownServers = runningModeControl.getRestartMode() == RestartMode.SERVERS;
        if (shutdownServers) {
            Runnable task = new Runnable() {
                @Override
                public void run() {
                    try {
                        serverInventory.shutdown(true, -1, true); // TODO graceful shutdown
                        serverInventory = null;
                        // client.getValue().setServerInventory(null);
                    } finally {
                        serverCallback.getValue().setCallbackHandler(null);
                        context.complete();
                    }
                }
            };
            try {
                executorService.getValue().execute(task);
            } catch (RejectedExecutionException e) {
                task.run();
            } finally {
                context.asynchronous();
            }
        } else {
            // We have to set the shutdown flag in any case
            serverInventory.shutdown(false, -1, true);
            serverInventory = null;
        }
    }
838725
def do_stopInstance(self,args):
        """"""
        parser = CommandArgumentParser("stopInstance")
        parser.add_argument(dest='instance',help='instance index or name');
        parser.add_argument('-f','--force',action='store_true',dest='force',help='instance index or name');
        args = vars(parser.parse_args(args))

        instanceId = args['instance']
        force = args['force']
        try:
            index = int(instanceId)
            instances = self.scalingGroupDescription['AutoScalingGroups'][0]['Instances']
            instanceId = instances[index]
        except ValueError:
            pass

        client = AwsConnectionFactory.getEc2Client()
        client.stop_instances(InstanceIds=[instanceId['InstanceId']],Force=force)
293568
private Exit exit(final Exit exit) {
        final long start = System.currentTimeMillis();
        final long max = this.options.lifetime();
        return new Exit.Or(
            exit,
            new Lifetime(start, max)
        );
    }
185022
public final boolean stop() {

        if (booting || running) {
            stopping = true;
            booting = false;
            onStopping();
            return true;
        } else {
            return false;
        }

    }
196244
@Override
  public synchronized void stop() {
    if (this.stopStatus.isStopInProgress()) {
      return;
    }

    this.stopStatus.setStopInprogress(true);

    LOGGER.info("Stopping the Gobblin Cluster Manager");

    if (this.idleProcessThread != null) {
      try {
        this.idleProcessThread.join();
      } catch (InterruptedException ie) {
        Thread.currentThread().interrupt();
      }
    }

    // Send a shutdown request to all GobblinTaskRunners unless running in standalone mode.
    // In standalone mode a failing manager should not stop the whole cluster.
    if (!this.isStandaloneMode) {
      sendShutdownRequest();
    }

    stopAppLauncherAndServices();

    this.multiManager.disconnect();
  }
1181173
@Override
    public void stop() throws Exception {
        try {
            // close gui
            super.stop();
        } catch (Exception ex) {
            exit(255, new CouldNotPerformException("Could not proper stop " + JPService.getApplicationName(), ex));
        }

        // make sure all shutdown deamons are triggered
        exit();
    }
949717
public Javalin stop() {
        eventManager.fireEvent(JavalinEvent.SERVER_STOPPING);
        log.info("Stopping Javalin ...");
        try {
            server.server().stop();
        } catch (Exception e) {
            log.error("Javalin failed to stop gracefully", e);
        }
        log.info("Javalin has stopped");
        eventManager.fireEvent(JavalinEvent.SERVER_STOPPED);
        return this;
    }
679741
public static xen stop(nitro_service client, xen resource) throws Exception
	{
		return ((xen[]) resource.perform_operation(client, "stop"))[0];
	}
728207
public Optional<String> stop() {
        final LinkedList<String> uuids = context.get();
        if (!uuids.isEmpty()) {
            return Optional.of(uuids.pop());
        }
        return Optional.empty();
    }
609878
@Stop
   public void stop() {
      if (needToUnregister) {
         // Only unregister the non cache MBean so that it can be restarted
         try {
            unregisterMBeans(nonCacheDMBeans);
            needToUnregister = false;
         } catch (Exception e) {
            log.problemsUnregisteringMBeans(e);
         }
      }

      // If removing cache, also remove cache MBean
      if (unregisterCacheMBean)
         globalJmxRegistration.unregisterCacheMBean(this.cacheName, this.cacheConfiguration
            .clustering().cacheModeString());

      // make sure we don't set cache to null, in case it needs to be restarted via JMX.
   }