public class ServerLauncher extends AbstractLauncher<java.lang.String>
AbstractLauncher
,
LocatorLauncher
Modifier and Type | Class and Description |
---|---|
static class |
ServerLauncher.Builder
The Builder class, modeled after the Builder creational design pattern, is used to construct a
properly configured and initialized instance of the ServerLauncher to control and run GemFire
servers (in particular, cache servers).
|
static class |
ServerLauncher.Command
An enumerated type representing valid commands to the Server launcher.
|
static class |
ServerLauncher.ServerState
The ServerState is an immutable type representing the state of the specified Locator at any
given moment in time.
|
AbstractLauncher.ServiceState<T extends java.lang.Comparable<T>>, AbstractLauncher.Status
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SERVER_PID_FILE
Deprecated.
This is specific to the internal implementation and may go away in a future
release.
|
protected static java.lang.Integer |
DEFAULT_SERVER_PORT
Deprecated.
This is specific to the internal implementation and may go away in a future
release.
|
DEFAULT_FORCE, DEFAULT_WORKING_DIRECTORY, logger, OPTION_PREFIX, READ_PID_FILE_TIMEOUT_MILLIS, running, SIGNAL_HANDLER_REGISTRATION_SYSTEM_PROPERTY
Modifier and Type | Method and Description |
---|---|
org.apache.geode.internal.cache.CacheConfig |
getCacheConfig()
Gets the CacheConfig object used to configure additional GemFire Cache components and features
(e.g.
|
ServerLauncher.Command |
getCommand()
Get the Server launcher command used to invoke the Server.
|
java.lang.Float |
getCriticalHeapPercentage() |
java.lang.Float |
getCriticalOffHeapPercentage() |
java.lang.Float |
getEvictionHeapPercentage() |
java.lang.Float |
getEvictionOffHeapPercentage() |
java.lang.String |
getHostNameForClients() |
java.lang.String |
getId()
Gets an identifier that uniquely identifies and represents the Server associated with this
launcher.
|
static ServerLauncher |
getInstance()
Gets the instance of the ServerLauncher used to launch the GemFire Cache Server, or null if
this VM does not have an instance of ServerLauncher indicating no GemFire Cache Server is
running.
|
java.lang.String |
getLogFileName()
Gets the name of the log file used to log information about this Server.
|
java.lang.Integer |
getMaxConnections() |
java.lang.Integer |
getMaxMessageCount() |
java.lang.Integer |
getMaxThreads() |
java.lang.String |
getMemberName()
Gets the name of this member (this Server) in the GemFire distributed system as determined by
the 'name' GemFire property.
|
java.lang.Integer |
getMessageTimeToLive() |
java.lang.Integer |
getPid()
Gets the user-specified process ID (PID) of the running Server that ServerLauncher uses to
issue status and stop commands to the Server.
|
java.util.Properties |
getProperties()
Gets the GemFire Distributed System (cluster) Properties.
|
java.net.InetAddress |
getServerBindAddress()
Gets the IP address to which the Server is bound listening for and accepting cache client
connections.
|
java.lang.String |
getServerBindAddressAsString()
Gets the host, as either hostname or IP address, on which the Server was bound and running.
|
protected java.io.File |
getServerPidFile()
Gets a File reference with the path to the PID file for the Server.
|
java.lang.Integer |
getServerPort()
Gets the port on which the Server is listening for cache client connections.
|
java.lang.String |
getServerPortAsString()
Gets the server port on which the Server is listening for client requests represented as a
String value.
|
static ServerLauncher.ServerState |
getServerState()
Gets the ServerState for this process or null if this process was not launched using this VM's
ServerLauncher reference .
|
java.lang.String |
getServiceName()
Gets the name for a GemFire Server.
|
java.lang.Integer |
getSocketBufferSize() |
java.lang.String |
getSpringXmlLocation()
Gets the location of the Spring XML configuration meta-data file used to bootstrap, configure
and initialize the GemFire Server on start.
|
java.lang.String |
getWorkingDirectory()
Gets the working directory pathname in which the Server will be run.
|
void |
help(ServerLauncher.Command command)
Displays help for the specified Server launcher command to standard err.
|
boolean |
isAssignBuckets()
Determines whether buckets should be assigned to partitioned regions in the cache upon Server
start.
|
protected boolean |
isAssignBucketsAllowed(Cache cache)
Determines whether the user indicated that buckets should be assigned on cache server start
using the --assign-buckets command-line option (switch) at the command-line as well as whether
the option is technically allowed.
|
protected boolean |
isDefaultServerEnabled(Cache cache)
Determines whether a default server (a cache server) should be created on startup as determined
by the absence of specifying the --disable-default-server command-line option (switch).
|
boolean |
isDisableDefaultServer()
Determines whether a default cache server will be added when the GemFire Server comes online.
|
boolean |
isForcing()
Determines whether the PID file is allowed to be overwritten when the Server is started and a
PID file already exists in the Server's specified working directory.
|
boolean |
isHelping()
Determines whether this launcher will be used to display help information.
|
boolean |
isRebalancing()
Determines whether a rebalance operation on the cache will occur upon starting the GemFire
server using this launcher.
|
boolean |
isRedirectingOutput()
Determines whether this launcher will redirect output to system logs when starting a new
Locator process.
|
protected boolean |
isServing(Cache cache)
Determines whether the specified Cache has any CacheServers.
|
boolean |
isSpringXmlLocationSpecified()
Determines whether this GemFire Server was configured and initialized with Spring configuration
meta-data.
|
protected boolean |
isStartingOrRunning()
Determines whether the Server is the process of starting or is already running.
|
static void |
main(java.lang.String... args)
Launches a GemFire Server from the command-line configured with the given arguments.
|
void |
run()
A Runnable method used to invoke the GemFire server (cache server) with the specified command.
|
ServerLauncher.ServerState |
start()
Invokes the 'start' command and operation to startup a GemFire server (a cache server).
|
ServerLauncher.ServerState |
status()
Invokes the 'status' command and operation to check the status of a GemFire server (a cache
server).
|
ServerLauncher.ServerState |
stop()
Invokes the 'stop' command and operation to stop a GemFire server (a cache server).
|
void |
usage()
Displays usage information on the proper invocation of the ServerLauncher from the command-line
to standard err.
|
void |
waitOnServer()
Causes the calling Thread to block until the GemFire Cache Server/Data Member stops.
|
assertPortAvailable, assertPortAvailable, debug, debug, getDistributedSystemProperties, getDistributedSystemProperties, getLogFile, getLogFileCanonicalPath, getMember, getMemberId, info, isDebugging, isRunning, isSet, loadGemFireProperties, redirectOutput, setDebug, version
protected static final java.lang.Integer DEFAULT_SERVER_PORT
public static final java.lang.String DEFAULT_SERVER_PID_FILE
public static void main(java.lang.String... args)
args
- the command-line arguments used to configure the GemFire Server at runtime.public static ServerLauncher getInstance()
public static ServerLauncher.ServerState getServerState()
public final org.apache.geode.internal.cache.CacheConfig getCacheConfig()
public final java.lang.String getId()
getServerBindAddressAsString()
,
getServerPortAsString()
public ServerLauncher.Command getCommand()
ServerLauncher.Command
public boolean isAssignBuckets()
public boolean isDisableDefaultServer()
public boolean isForcing()
public boolean isHelping()
ServerLauncher.Command
public boolean isRebalancing()
public boolean isRedirectingOutput()
public java.lang.String getLogFileName()
getLogFileName
in class AbstractLauncher<java.lang.String>
public java.lang.String getMemberName()
getMemberName
in class AbstractLauncher<java.lang.String>
AbstractLauncher.getMemberName()
public java.lang.Integer getPid()
getPid
in class AbstractLauncher<java.lang.String>
public java.util.Properties getProperties()
Properties
public java.net.InetAddress getServerBindAddress()
public java.lang.String getServerBindAddressAsString()
InetAddress
,
getServerBindAddress()
public java.lang.Integer getServerPort()
public java.lang.String getServerPortAsString()
getServerPort()
public java.lang.String getServiceName()
getServiceName
in class AbstractLauncher<java.lang.String>
public java.lang.String getSpringXmlLocation()
ServerLauncher.Builder.getSpringXmlLocation()
public boolean isSpringXmlLocationSpecified()
public java.lang.String getWorkingDirectory()
getWorkingDirectory
in class AbstractLauncher<java.lang.String>
public java.lang.Float getCriticalHeapPercentage()
public java.lang.Float getEvictionHeapPercentage()
public java.lang.Float getCriticalOffHeapPercentage()
public java.lang.Float getEvictionOffHeapPercentage()
public java.lang.String getHostNameForClients()
public java.lang.Integer getMaxConnections()
public java.lang.Integer getMaxMessageCount()
public java.lang.Integer getMessageTimeToLive()
public java.lang.Integer getMaxThreads()
public java.lang.Integer getSocketBufferSize()
public void help(ServerLauncher.Command command)
command
- the Server launcher command in which to display help information.usage()
public void usage()
public void run()
Runnable
protected java.io.File getServerPidFile()
public ServerLauncher.ServerState start()
run()
protected boolean isServing(Cache cache)
cache
- the Cache to check for existing CacheServers.public void waitOnServer()
protected boolean isDefaultServerEnabled(Cache cache)
cache
- the reference to the Cache to check for any existing cache servers.isDisableDefaultServer()
protected boolean isAssignBucketsAllowed(Cache cache)
cache
- the Cache reference to check for instance type.isAssignBuckets()
protected boolean isStartingOrRunning()
public ServerLauncher.ServerState status()
public ServerLauncher.ServerState stop()