/** * Determines whether a GemFire Locator can be started with this instance of LocatorLauncher. * * @return a boolean indicating whether a GemFire Locator can be started with this instance of * LocatorLauncher, which is true if the LocatorLauncher has not already started a Locator * or a Locator is not already running. * @see #start() */ private boolean isStartable() { return (!isRunning() && this.starting.compareAndSet(false, true)); }
/** * Determines whether the Locator can be stopped in-process, such as when a Locator is embedded in * an application and the LocatorLauncher API is being used. * * @return a boolean indicating whether the Locator can be stopped in-process (the application's * process with an embedded Locator). */ protected boolean isStoppable() { return (isRunning() && getInternalLocator() != null); }
@Test public void buildCreatesLocatorLauncherWithBuilderValues() throws Exception { Builder builder = new Builder(); LocatorLauncher launcher = builder.setCommand(Command.START).setDebug(true) .setHostnameForClients("beanstock.vmware.com").setMemberName("Beanstock").setPort(8192) .setRedirectOutput(Boolean.TRUE).build(); assertThat(launcher.getCommand()).isEqualTo(builder.getCommand()); assertThat(launcher.isDebugging()).isTrue(); assertThat(launcher.getHostnameForClients()).isEqualTo(builder.getHostnameForClients()); assertThat(launcher.getMemberName()).isEqualTo(builder.getMemberName()); assertThat(launcher.getPort()).isEqualTo(builder.getPort()); assertThat(launcher.getWorkingDirectory()).isEqualTo(builder.getWorkingDirectory()); assertThat(launcher.isRedirectingOutput()).isTrue(); assertThat(launcher.isHelping()).isFalse(); assertThat(launcher.isRunning()).isFalse(); }
else if (isRunning()) { debug("Getting Locator status using host (%1$s) and port (%2$s)%n", getBindAddressAsString(), getPortAsString());