public final class LocatorLauncher extends AbstractLauncher<String>
AbstractLauncher
,
ServerLauncher
Modifier and Type | Class and Description |
---|---|
static class |
LocatorLauncher.Builder
Following the Builder design pattern, the LocatorLauncher Builder is used to configure and create a properly
initialized instance of the LocatorLauncher class for running the Locator and performing other Locator
operations.
|
static class |
LocatorLauncher.Command
An enumerated type representing valid commands to the Locator launcher.
|
static class |
LocatorLauncher.LocatorState
The LocatorState is an immutable type representing the state of the specified Locator at any given moment in time.
|
AbstractLauncher.ServiceState<T extends Comparable<T>>, AbstractLauncher.Status
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ENABLE_PEER_LOCATION
Deprecated.
This is specific to the internal implementation and may go away in a future release.
|
static boolean |
DEFAULT_ENABLE_SERVER_LOCATION
Deprecated.
This is specific to the internal implementation and may go away in a future release.
|
static String |
DEFAULT_LOCATOR_PID_FILE
Deprecated.
This is specific to the internal implementation and may go away in a future release.
|
static Integer |
DEFAULT_LOCATOR_PORT
Deprecated.
This is specific to the internal implementation and may go away in a future release.
|
DEFAULT_WORKING_DIRECTORY, SIGNAL_HANDLER_REGISTRATION_SYSTEM_PROPERTY
Modifier and Type | Method and Description |
---|---|
InetAddress |
getBindAddress()
Gets the IP address of the NIC to which the Locator has bound itself listening for client requests.
|
LocatorLauncher.Command |
getCommand()
Get the Locator launcher command used to invoke the Locator.
|
String |
getHostnameForClients()
Gets the hostname that clients will use to lookup the running Locator.
|
String |
getId()
Gets an identifier that uniquely identifies and represents the Locator associated with this launcher.
|
static LocatorLauncher |
getInstance()
Gets the instance of the LocatorLauncher used to launch the GemFire Locator, or null if this VM does not
have an instance of LocatorLauncher indicating no GemFire Locator is running.
|
static LocatorLauncher.LocatorState |
getLocatorState()
Gets the LocatorState for this process or null if this process was not launched using this VM's
LocatorLauncher reference.
|
String |
getLogFileName()
Gets the name of the log file used to log information about this Locator.
|
String |
getMemberName()
Gets the name of this member (this Locator) in the GemFire distributed system and determined by the 'name' GemFire
property.
|
Integer |
getPid()
Gets the user-specified process ID (PID) of the running Locator that LocatorLauncher uses to issue status and
stop commands to the Locator.
|
Integer |
getPort()
Gets the port number on which the Locator listens for client requests.
|
String |
getPortAsString()
Gets the port number represented as a String value.
|
Properties |
getProperties()
Gets the GemFire Distributed System (cluster) Properties.
|
String |
getServiceName()
Gets the name for a GemFire Locator.
|
String |
getWorkingDirectory()
Gets the working directory pathname in which the Locator will be run.
|
void |
help(LocatorLauncher.Command command)
Displays help for the specified Locator launcher command to standard err.
|
boolean |
isForcing()
Determines whether the PID file is allowed to be overwritten when the Locator is started and a PID file
already exists in the Locator's specified working directory.
|
boolean |
isHelping()
Determines whether this launcher will be used to display help information.
|
boolean |
isRedirectingOutput()
Determines whether this launcher will redirect output to system logs when
starting a new Locator process.
|
static void |
main(String... args)
Launches a GemFire Locator from the command-line configured with the given arguments.
|
void |
run()
The Runnable method used to launch the Locator with the specified command.
|
LocatorLauncher.LocatorState |
start()
Starts a Locator running on the specified port and bind address, as determined by getPort and getBindAddress
respectively, defaulting to 10334 and 'localhost' if not specified, with both peer and server location enabled.
|
LocatorLauncher.LocatorState |
status()
Attempts to determine the state of the Locator.
|
LocatorLauncher.LocatorState |
stop()
Stop shuts the running Locator down.
|
void |
usage()
Displays usage information on the proper invocation of the LocatorLauncher from the command-line to standard err.
|
LocatorLauncher.LocatorState |
waitOnLocator()
Waits on the Locator to stop causing the calling Thread to join with the Locator's location-based services Thread.
|
LocatorLauncher.LocatorState |
waitOnStatusResponse(long timeout,
long interval,
TimeUnit timeUnit)
Waits for a Locator status request response to be returned up to the specified timeout in the given unit of time.
|
getMember, getMemberId, isDebugging, isRunning, setDebug, version
public static final Integer DEFAULT_LOCATOR_PORT
public static final boolean DEFAULT_ENABLE_PEER_LOCATION
public static final boolean DEFAULT_ENABLE_SERVER_LOCATION
public static final String DEFAULT_LOCATOR_PID_FILE
public static void main(String... args)
args
- the command-line arguments used to configure the GemFire Locator at runtime.public static LocatorLauncher getInstance()
public static LocatorLauncher.LocatorState getLocatorState()
public final String getId()
getBindAddressAsString()
,
getPortAsString()
public LocatorLauncher.Command getCommand()
LocatorLauncher.Command
public boolean isForcing()
public boolean isHelping()
LocatorLauncher.Command
public boolean isRedirectingOutput()
public InetAddress getBindAddress()
InetAddress
public String getHostnameForClients()
public String getLogFileName()
getLogFileName
in class AbstractLauncher<String>
public String getMemberName()
getMemberName
in class AbstractLauncher<String>
AbstractLauncher.getMemberName()
public Integer getPid()
getPid
in class AbstractLauncher<String>
public Integer getPort()
public String getPortAsString()
getPort()
public Properties getProperties()
Properties
public String getServiceName()
getServiceName
in class AbstractLauncher<String>
public String getWorkingDirectory()
getWorkingDirectory
in class AbstractLauncher<String>
public void help(LocatorLauncher.Command command)
command
- the Locator launcher command in which to display help information.usage()
public void usage()
public void run()
public LocatorLauncher.LocatorState start()
waitOnLocator
.
Given the nature of start, the Locator's status will be in either 1 of 2 possible states. If the 'request' to
start the Locator proceeds without exception, the status will be 'STARTED'. However, if any exception is
encountered during the normal startup sequence, then a RuntimeException is thrown and the status is set to
'STOPPED'.RuntimeException
- if the Locator failed to start for any reason.IllegalStateException
- if the Locator is already running.failOnStart(Throwable)
,
getBindAddress()
,
getDistributedSystemProperties()
,
isForcing()
,
AbstractLauncher.getLogFile()
,
getLocatorPidFile()
,
getPort()
,
status()
,
stop()
,
waitOnLocator()
,
waitOnStatusResponse(long, long, java.util.concurrent.TimeUnit)
,
LocatorLauncher.LocatorState
,
AbstractLauncher.Status.NOT_RESPONDING
,
AbstractLauncher.Status.ONLINE
,
AbstractLauncher.Status.STARTING
public LocatorLauncher.LocatorState waitOnLocator()
AssertionError
- if the Locator has not been started and the reference is null (assertions must be enabled
for the error to be thrown).failOnStart(Throwable)
,
AbstractLauncher.Status
,
LocatorLauncher.LocatorState
public LocatorLauncher.LocatorState waitOnStatusResponse(long timeout, long interval, TimeUnit timeUnit)
waitOnLocator
.timeout
- a long value in time unit indicating when the period of time should expire in attempting
to determine the Locator's status.interval
- a long value in time unit for how frequent the requests should be sent to the Locator.timeUnit
- the unit of time in which the timeout and interval are measured.waitOnLocator()
public LocatorLauncher.LocatorState status()
start()
,
stop()
,
AbstractLauncher.Status
,
LocatorLauncher.LocatorState
public LocatorLauncher.LocatorState stop()
start()
,
status()
,
LocatorLauncher.LocatorState
,
AbstractLauncher.Status.NOT_RESPONDING
,
AbstractLauncher.Status.STOPPED
Copyright © 1997-2017 Pivotal Software, Inc. All rights reserved.