private LocatorState statusWithPid() { try { final ProcessController controller = new ProcessControllerFactory() .createProcessController(this.controllerParameters, getPid()); controller.checkPidSupport(); final String statusJson = controller.status(); return LocatorState.fromJson(statusJson); } catch (ConnectionFailedException handled) { // failed to attach to locator JVM return createNoResponseState(handled, "Failed to connect to locator with process id " + getPid()); } catch (IOException | MBeanInvocationFailedException | UnableToControlProcessException | TimeoutException handled) { return createNoResponseState(handled, "Failed to communicate with locator with process id " + getPid()); } catch (InterruptedException handled) { Thread.currentThread().interrupt(); return createNoResponseState(handled, "Interrupted while trying to communicate with locator with process id " + getPid()); } }
} catch (ConnectionFailedException handled) { return createNoResponseState(handled, "Failed to connect to locator with process id " + parsedPid); } catch (FileNotFoundException handled) { return createNoResponseState(handled, "Failed to find process file " + ProcessType.LOCATOR.getPidFileName() + " in " + getWorkingDirectory()); } catch (IOException | MBeanInvocationFailedException | UnableToControlProcessException | TimeoutException handled) { return createNoResponseState(handled, "Failed to communicate with locator with process id " + parsedPid); } catch (PidUnavailableException e) { return createNoResponseState(e, "Failed to find usable process id within file " + ProcessType.LOCATOR.getPidFileName() + " in " + getWorkingDirectory()); } catch (InterruptedException handled) { Thread.currentThread().interrupt(); return createNoResponseState(handled, "Interrupted while trying to communicate with locator with process id " + parsedPid);
} catch (ConnectionFailedException handled) { return createNoResponseState(handled, "Failed to connect to locator with process id " + parsedPid); } catch (FileNotFoundException handled) { return createNoResponseState(handled, "Failed to find process file " + ProcessType.LOCATOR.getPidFileName() + " in " + getWorkingDirectory()); } catch (IOException | MBeanInvocationFailedException | UnableToControlProcessException handled) { return createNoResponseState(handled, "Failed to communicate with locator with process id " + parsedPid); } catch (InterruptedException handled) { Thread.currentThread().interrupt(); return createNoResponseState(handled, "Interrupted while trying to communicate with locator with process id " + parsedPid); } catch (PidUnavailableException handled) { return createNoResponseState(handled, "Failed to find usable process id within file " + ProcessType.LOCATOR.getPidFileName() + " in " + getWorkingDirectory()); } catch (TimeoutException handled) { return createNoResponseState(handled, "Timed out trying to find usable process id within file " + ProcessType.LOCATOR.getPidFileName() + " in " + getWorkingDirectory());
private LocatorState stopWithPid() { try { final ProcessController controller = new ProcessControllerFactory() .createProcessController(new LocatorControllerParameters(), getPid()); controller.checkPidSupport(); controller.stop(); return new LocatorState(this, Status.STOPPED); } catch (ConnectionFailedException handled) { // failed to attach to locator JVM return createNoResponseState(handled, "Failed to connect to locator with process id " + getPid()); } catch (IOException | MBeanInvocationFailedException | UnableToControlProcessException handled) { return createNoResponseState(handled, "Failed to communicate with locator with process id " + getPid()); } }
private LocatorState statusWithPort() { try { LocatorStatusResponse response = statusLocator(getPort(), getBindAddress()); return new LocatorState(this, Status.ONLINE, response); } catch (Exception handled) { return createNoResponseState(handled, "Failed to connect to locator " + getBindAddressAsString() + "[" + getPort() + "]"); } }