public static class ServerLauncher.Builder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static ServerLauncher.Command |
DEFAULT_COMMAND |
Constructor and Description |
---|
Builder()
Default constructor used to create an instance of the Builder class for programmatical
access.
|
Builder(java.lang.String... args)
Constructor used to create and configure an instance of the Builder class with the specified
arguments, passed in from the command-line when launching an instance of this class from the
command-line using the Java launcher.
|
Modifier and Type | Method and Description |
---|---|
ServerLauncher |
build()
Validates the Builder configuration settings and then constructs an instance of the
ServerLauncher class to invoke operations on a GemFire Server.
|
java.lang.Boolean |
getAssignBuckets()
Determines whether buckets should be assigned to partitioned regions in the cache upon Server
start.
|
ServerLauncher.Command |
getCommand()
Gets the Server launcher command used during the invocation of the ServerLauncher.
|
java.lang.Float |
getCriticalHeapPercentage() |
java.lang.Float |
getCriticalOffHeapPercentage() |
java.lang.Boolean |
getDebug()
Determines whether the new instance of the ServerLauncher will be set to debug mode.
|
java.lang.Boolean |
getDisableDefaultServer()
Determines whether a default cache server will be added when the GemFire Server comes online.
|
java.util.Properties |
getDistributedSystemProperties()
Gets the GemFire Distributed System (cluster) Properties configuration.
|
java.lang.Float |
getEvictionHeapPercentage() |
java.lang.Float |
getEvictionOffHeapPercentage() |
java.lang.Boolean |
getForce()
Gets the boolean value used by the Server to determine if it should overwrite the PID file if
it already exists.
|
java.lang.Boolean |
getHelp()
Determines whether the new instance of the ServerLauncher will be used to output help
information for either a specific command, or for using ServerLauncher in general.
|
java.lang.String |
getHostNameForClients() |
java.lang.Integer |
getMaxConnections() |
java.lang.Integer |
getMaxMessageCount() |
java.lang.Integer |
getMaxThreads() |
java.lang.String |
getMemberName()
Gets the member name of this Server in GemFire.
|
java.lang.Integer |
getMessageTimeToLive() |
java.lang.Integer |
getPid()
Gets the process ID (PID) of the running Server indicated by the user as an argument to the
ServerLauncher.
|
java.lang.Boolean |
getRebalance()
Determines whether a rebalance operation on the cache will occur upon starting the GemFire
server.
|
java.lang.Boolean |
getRedirectOutput()
Determines whether the new instance of LocatorLauncher will redirect output to system logs
when starting a Locator.
|
java.net.InetAddress |
getServerBindAddress()
Gets the IP address to which the Server will be bound listening for and accepting cache
client connections in a client/server topology.
|
java.lang.Integer |
getServerPort()
Gets the port on which the Server will listen for and accept cache client connections in a
client/server topology.
|
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 ran.
|
protected boolean |
isHelping()
Determines whether help has been enabled.
|
protected void |
parseArguments(java.lang.String... args)
Parses the list of arguments to configure this Builder with the intent of constructing a
Server launcher to invoke a Cache Server.
|
protected void |
parseCommand(java.lang.String... args)
Iterates the list of arguments in search of the target Server launcher command.
|
protected void |
parseMemberName(java.lang.String... args)
Iterates the list of arguments in search of the Server's GemFire member name.
|
ServerLauncher.Builder |
set(java.lang.String propertyName,
java.lang.String propertyValue)
Sets a GemFire Distributed System Property.
|
ServerLauncher.Builder |
setAssignBuckets(java.lang.Boolean assignBuckets)
Sets whether buckets should be assigned to partitioned regions in the cache upon Server
start.
|
ServerLauncher.Builder |
setCommand(ServerLauncher.Command command)
Sets the Sever launcher command used during the invocation of the ServerLauncher
|
ServerLauncher.Builder |
setCriticalHeapPercentage(java.lang.Float criticalHeapPercentage) |
ServerLauncher.Builder |
setCriticalOffHeapPercentage(java.lang.Float criticalOffHeapPercentage) |
ServerLauncher.Builder |
setDebug(java.lang.Boolean debug)
Sets whether the new instance of the ServerLauncher will be set to debug mode.
|
ServerLauncher.Builder |
setDisableDefaultServer(java.lang.Boolean disableDefaultServer)
Sets a boolean value indicating whether to add a default cache when the GemFire Server comes
online.
|
ServerLauncher.Builder |
setEvictionHeapPercentage(java.lang.Float evictionHeapPercentage) |
ServerLauncher.Builder |
setEvictionOffHeapPercentage(java.lang.Float evictionOffHeapPercentage) |
ServerLauncher.Builder |
setForce(java.lang.Boolean force)
Sets the boolean value used by the Server to determine if it should overwrite the PID file if
it already exists.
|
ServerLauncher.Builder |
setHelp(java.lang.Boolean help)
Sets whether the new instance of ServerLauncher will be used to output help information for
either a specific command, or for using ServerLauncher in general.
|
ServerLauncher.Builder |
setHostNameForClients(java.lang.String hostNameForClients) |
ServerLauncher.Builder |
setMaxConnections(java.lang.Integer maxConnections) |
ServerLauncher.Builder |
setMaxMessageCount(java.lang.Integer maxMessageCount) |
ServerLauncher.Builder |
setMaxThreads(java.lang.Integer maxThreads) |
ServerLauncher.Builder |
setMemberName(java.lang.String memberName)
Sets the member name of the Server in GemFire.
|
ServerLauncher.Builder |
setMessageTimeToLive(java.lang.Integer messageTimeToLive) |
ServerLauncher.Builder |
setPdxDiskStore(java.lang.String pdxDiskStore)
Sets the GemFire Disk Store to be used to persist PDX type meta-data.
|
ServerLauncher.Builder |
setPdxIgnoreUnreadFields(boolean ignore)
Sets whether fields in the PDX instance should be ignored when unread.
|
ServerLauncher.Builder |
setPdxPersistent(boolean persistent)
Sets whether the PDX type meta-data should be persisted to disk.
|
ServerLauncher.Builder |
setPdxReadSerialized(boolean readSerialized)
Sets whether PDX instances should be returned as is when Region.get(key:String):Object is
called.
|
ServerLauncher.Builder |
setPdxSerializer(PdxSerializer pdxSerializer)
Set the PdxSerializer to use to serialize POJOs to the GemFire Cache Region or when sent
between peers, client/server, or during persistence to disk.
|
ServerLauncher.Builder |
setPid(java.lang.Integer pid)
Sets the process ID (PID) of the running Server indicated by the user as an argument to the
ServerLauncher.
|
ServerLauncher.Builder |
setRebalance(java.lang.Boolean rebalance)
Set a boolean value indicating whether a rebalance operation on the cache should occur upon
starting the GemFire server.
|
ServerLauncher.Builder |
setRedirectOutput(java.lang.Boolean redirectOutput)
Sets whether the new instance of LocatorLauncher will redirect output to system logs when
starting a Locator.
|
ServerLauncher.Builder |
setServerBindAddress(java.lang.String serverBindAddress)
Sets the IP address to which the Server will be bound listening for and accepting cache
client connections in a client/server topology.
|
ServerLauncher.Builder |
setServerPort(java.lang.Integer serverPort)
Sets the port on which the Server will listen for and accept cache client connections in a
client/server topology.
|
ServerLauncher.Builder |
setSocketBufferSize(java.lang.Integer socketBufferSize) |
ServerLauncher.Builder |
setSpringXmlLocation(java.lang.String springXmlLocation)
Sets the location of the Spring XML configuration meta-data file used to bootstrap, configure
and initialize the GemFire Server on start.
|
ServerLauncher.Builder |
setWorkingDirectory(java.lang.String workingDirectory)
Sets the working directory in which the Server will be ran.
|
protected void |
validate()
Validates the configuration settings and properties of this Builder, ensuring that all
invariants have been met.
|
protected void |
validateOnStart()
Validates the arguments passed to the Builder when the 'start' command has been issued.
|
protected void |
validateOnStatus()
Validates the arguments passed to the Builder when the 'status' command has been issued.
|
protected void |
validateOnStop()
Validates the arguments passed to the Builder when the 'stop' command has been issued.
|
protected static final ServerLauncher.Command DEFAULT_COMMAND
public Builder()
public Builder(java.lang.String... args)
args
- the array of arguments used to configure the Builder.parseArguments(String...)
protected void parseArguments(java.lang.String... args)
args
- the array of arguments used to configure this Builder and create an instance of
ServerLauncher.protected void parseCommand(java.lang.String... args)
args
- an array of arguments from which to search for the Server launcher command.ServerLauncher.Command.valueOfName(String)
,
parseArguments(String...)
protected void parseMemberName(java.lang.String... args)
args
- the array of arguments from which to search for the Server's member name in
GemFire.ServerLauncher.Command.isCommand(String)
,
parseArguments(String...)
public ServerLauncher.Command getCommand()
setCommand(org.apache.geode.distributed.ServerLauncher.Command)
,
ServerLauncher.Command
public ServerLauncher.Builder setCommand(ServerLauncher.Command command)
command
- the targeted Server launcher command used during the invocation (run) of
ServerLauncher.getCommand()
,
ServerLauncher.Command
public java.lang.Boolean getAssignBuckets()
setAssignBuckets(Boolean)
public ServerLauncher.Builder setAssignBuckets(java.lang.Boolean assignBuckets)
assignBuckets
- a boolean indicating if buckets should be assigned upon Server start.getAssignBuckets()
public java.lang.Boolean getDebug()
setDebug(Boolean)
public ServerLauncher.Builder setDebug(java.lang.Boolean debug)
debug
- a boolean value indicating whether debug mode is to be enabled or disabled.getDebug()
public java.lang.Boolean getDisableDefaultServer()
setDisableDefaultServer(Boolean)
public ServerLauncher.Builder setDisableDefaultServer(java.lang.Boolean disableDefaultServer)
disableDefaultServer
- a boolean value indicating whether to add a default cache server.getDisableDefaultServer()
public java.util.Properties getDistributedSystemProperties()
Properties
public java.lang.Boolean getForce()
LocalProcessLauncher
,
setForce(Boolean)
public ServerLauncher.Builder setForce(java.lang.Boolean force)
force
- a boolean value indicating whether to overwrite the PID file when it already
exists.LocalProcessLauncher
,
getForce()
public java.lang.Boolean getHelp()
setHelp(Boolean)
protected final boolean isHelping()
public ServerLauncher.Builder setHelp(java.lang.Boolean help)
help
- a boolean indicating whether help information is to be displayed during
invocation of ServerLauncher.getHelp()
public java.lang.Boolean getRebalance()
setRebalance(Boolean)
public ServerLauncher.Builder setRebalance(java.lang.Boolean rebalance)
rebalance
- a boolean indicating if the cache will be rebalanced when the GemFire server
starts.getRebalance()
public java.lang.String getMemberName()
setMemberName(String)
public ServerLauncher.Builder setMemberName(java.lang.String memberName)
memberName
- a String indicating the member name of this Server in GemFire.java.lang.IllegalArgumentException
- if the member name is invalid.getMemberName()
public java.lang.Integer getPid()
setPid(Integer)
public ServerLauncher.Builder setPid(java.lang.Integer pid)
pid
- a user specified Integer value indicating the process ID of the running Server.java.lang.IllegalArgumentException
- if the process ID (PID) is not valid (greater than zero if
not null).getPid()
public java.lang.Boolean getRedirectOutput()
setRedirectOutput(Boolean)
public ServerLauncher.Builder setRedirectOutput(java.lang.Boolean redirectOutput)
redirectOutput
- a boolean value indicating if output will be redirected to system logs
when starting a Locator.getRedirectOutput()
public java.net.InetAddress getServerBindAddress()
setServerBindAddress(String)
public ServerLauncher.Builder setServerBindAddress(java.lang.String serverBindAddress)
serverBindAddress
- a String specifying the IP address or hostname that the Server will
be bound to listen for and accept cache client connections in a client/server
topology.java.lang.IllegalArgumentException
- wrapping the UnknownHostException if the IP address or
hostname for the server bind address is unknown.getServerBindAddress()
public java.lang.Integer getServerPort()
setServerPort(Integer)
public ServerLauncher.Builder setServerPort(java.lang.Integer serverPort)
serverPort
- an Integer value specifying the port the Server will listen on and accept
cache client connections in a client/server topology.java.lang.IllegalArgumentException
- if the port number is not valid.getServerPort()
public java.lang.String getSpringXmlLocation()
setSpringXmlLocation(String)
public ServerLauncher.Builder setSpringXmlLocation(java.lang.String springXmlLocation)
springXmlLocation
- a String indicating the location of the Spring XML configuration
file.getSpringXmlLocation()
public java.lang.String getWorkingDirectory()
setWorkingDirectory(String)
public ServerLauncher.Builder setWorkingDirectory(java.lang.String workingDirectory)
workingDirectory
- a String indicating the pathname of the directory in which the Server
will be ran.java.lang.IllegalArgumentException
- wrapping a FileNotFoundException if the working directory
pathname cannot be found.getWorkingDirectory()
,
FileNotFoundException
public java.lang.Float getCriticalHeapPercentage()
public ServerLauncher.Builder setCriticalHeapPercentage(java.lang.Float criticalHeapPercentage)
public java.lang.Float getCriticalOffHeapPercentage()
public ServerLauncher.Builder setCriticalOffHeapPercentage(java.lang.Float criticalOffHeapPercentage)
public java.lang.Float getEvictionHeapPercentage()
public ServerLauncher.Builder setEvictionHeapPercentage(java.lang.Float evictionHeapPercentage)
public java.lang.Float getEvictionOffHeapPercentage()
public ServerLauncher.Builder setEvictionOffHeapPercentage(java.lang.Float evictionOffHeapPercentage)
public java.lang.String getHostNameForClients()
public ServerLauncher.Builder setHostNameForClients(java.lang.String hostNameForClients)
public java.lang.Integer getMaxConnections()
public ServerLauncher.Builder setMaxConnections(java.lang.Integer maxConnections)
public java.lang.Integer getMaxMessageCount()
public ServerLauncher.Builder setMaxMessageCount(java.lang.Integer maxMessageCount)
public java.lang.Integer getMaxThreads()
public ServerLauncher.Builder setMaxThreads(java.lang.Integer maxThreads)
public java.lang.Integer getMessageTimeToLive()
public ServerLauncher.Builder setMessageTimeToLive(java.lang.Integer messageTimeToLive)
public java.lang.Integer getSocketBufferSize()
public ServerLauncher.Builder setSocketBufferSize(java.lang.Integer socketBufferSize)
public ServerLauncher.Builder set(java.lang.String propertyName, java.lang.String propertyValue)
propertyName
- a String indicating the name of the GemFire Distributed System property
as described in ConfigurationProperties
propertyValue
- a String value for the GemFire Distributed System property.public ServerLauncher.Builder setPdxPersistent(boolean persistent)
persistent
- a boolean indicating whether PDX type meta-data should be persisted to
disk.public ServerLauncher.Builder setPdxDiskStore(java.lang.String pdxDiskStore)
pdxDiskStore
- a String indicating the name of the GemFire Disk Store to use to store
PDX type meta-datapublic ServerLauncher.Builder setPdxIgnoreUnreadFields(boolean ignore)
ignore
- a boolean indicating whether unread fields in the PDX instance should be
ignored.public ServerLauncher.Builder setPdxReadSerialized(boolean readSerialized)
readSerialized
- a boolean indicating whether the PDX instance should be returned from a
call to Region.get(key:String):Objectpublic ServerLauncher.Builder setPdxSerializer(PdxSerializer pdxSerializer)
pdxSerializer
- the PdxSerializer that is used to serialize application domain objects
into PDX.protected void validate()
java.lang.IllegalStateException
- if the Builder is not properly configured.protected void validateOnStart()
ServerLauncher.Command.START
protected void validateOnStatus()
ServerLauncher.Command.STATUS
protected void validateOnStop()
ServerLauncher.Command.STOP
public ServerLauncher build()
validate()
,
ServerLauncher