@Override
 public void stopLocalHost() {
   final ProcessControllerClient client =
       injectedProcessControllerConnection.getValue().getClient();
   try {
     client.shutdown();
   } catch (IOException e) {
     throw new RuntimeException("Error closing down host", e);
   }
 }
 @Override
 public void stopLocalHost(int exitCode) {
   final ProcessControllerClient client =
       injectedProcessControllerConnection.getValue().getClient();
   processState.setStopping();
   try {
     client.shutdown(exitCode);
   } catch (IOException e) {
     throw MESSAGES.errorClosingDownHost(e);
   }
 }
Example #3
0
 synchronized void kill() {
   final InternalState required = this.requiredState;
   if (required == InternalState.STOPPED) {
     if (internalState != InternalState.STOPPED) {
       try {
         processControllerClient.killProcess(serverProcessName);
       } catch (IOException e) {
         ROOT_LOGGER.logf(DEBUG_LEVEL, e, "failed to send kill_process message to %s", serverName);
       }
     }
   } else {
     stop(-1, 0);
   }
 }
 @Override
 public synchronized Map<String, ProcessInfo> determineRunningProcesses() {
   processInventoryLatch = new CountDownLatch(1);
   try {
     processControllerClient.requestProcessInventory();
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
   try {
     if (!processInventoryLatch.await(30, TimeUnit.SECONDS)) {
       throw MESSAGES.couldNotGetServerInventory(
           30L, TimeUnit.SECONDS.toString().toLowerCase(Locale.US));
     }
   } catch (InterruptedException e) {
     throw MESSAGES.couldNotGetServerInventory(
         30L, TimeUnit.SECONDS.toString().toLowerCase(Locale.US));
   }
   return processInfos;
 }