public class RunCommand extends BareCommand
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cluster |
protected String |
config |
protected DeploymentOptions |
deploymentOptions |
protected boolean |
ha |
protected int |
instances |
protected String |
mainVerticle |
protected String |
onRedeployCommand |
protected List<String> |
redeploy |
protected String |
vertxApplicationBackgroundId |
protected Watcher |
watcher |
protected boolean |
worker |
clusterHost, clusterPort, clusterPublicHost, clusterPublicPort, DEPLOYMENT_OPTIONS_PROP_PREFIX, finalAction, haGroup, METRICS_OPTIONS_PROP_PREFIX, options, quorum, vertx, VERTX_OPTIONS_PROP_PREFIX, vertxOptionsclasspath, log, manager, PATH_SEPexecutionContext, out, systemProperties| Constructor and Description |
|---|
RunCommand() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterConfigParsed(JsonObject config) |
protected void |
afterStoppingVertx() |
protected void |
beforeDeployingVerticle(DeploymentOptions deploymentOptions) |
protected void |
beforeStoppingVertx(Vertx vertx) |
protected void |
deploy() |
protected JsonObject |
getConfiguration() |
boolean |
getHA() |
protected void |
initializeRedeployment()
Initializes the redeployment cycle.
|
boolean |
isClustered() |
void |
run()
Starts vert.x and deploy the verticle.
|
void |
setCluster(boolean cluster)
Enables / disables the clustering.
|
void |
setConfig(String configuration)
The main verticle configuration, it can be a json file or a json string.
|
void |
setHighAvailability(boolean ha)
Enables / disables the high-availability.
|
void |
setInstances(int instances)
Sets the number of instance of the verticle to create.
|
void |
setMainVerticle(String verticle)
Sets the main verticle that is deployed.
|
void |
setOnRedeployCommand(String command) |
void |
setOnRedeployCommandOld(String command)
Deprecated.
Use 'on-redeploy' instead. It will be removed in vert.x 3.3
|
void |
setRedeploy(List<String> redeploy) |
void |
setRedeployGracePeriod(long period) |
void |
setRedeployScanPeriod(long period) |
void |
setRedeployStopWaitingTime(long period) |
void |
setUp(ExecutionContext context)
Validates the command line parameters.
|
void |
setWorker(boolean worker)
Whether or not the verticle is deployed as a worker verticle.
|
protected void |
shutdownRedeployment()
Stop the redeployment if started.
|
protected void |
startAsBackgroundApplication(Handler<Void> onCompletion)
On-Deploy action invoked while redeploying.
|
protected void |
stopBackgroundApplication(Handler<Void> onCompletion)
On-Undeploy action invoked while redeploying.
|
addShutdownHook, afterStartingVertx, beforeStartingVertx, configureFromSystemProperties, getDefaultAddress, getJsonFromFileOrString, getMetricsOptions, getMetricsOptions, getTerminationRunnable, run, setClusterHost, setClusterPort, setClusterPublicHost, setClusterPublicPort, setExecutionContext, setHAGroup, setQuorum, setVertxOptions, startVertx, vertxcreate, create, createClassloader, deploy, newInstance, setClasspathapplySystemProperties, getCwd, out, setCwd, setSystemProps, tearDownprotected DeploymentOptions deploymentOptions
protected boolean cluster
protected boolean ha
protected int instances
protected String config
protected boolean worker
protected String mainVerticle
protected String vertxApplicationBackgroundId
protected String onRedeployCommand
protected Watcher watcher
public void setHighAvailability(boolean ha)
ha - whether or not to enable the HA.public void setCluster(boolean cluster)
cluster - whether or not to start vert.x in clustered mode.public void setWorker(boolean worker)
worker - true to deploy the verticle as worker, false otherwisepublic void setInstances(int instances)
instances - the number of instancespublic void setConfig(String configuration)
configuration - the configurationpublic void setMainVerticle(String verticle)
verticle - the verticle@Deprecated public void setOnRedeployCommandOld(String command)
command - the on redeploy commandpublic void setOnRedeployCommand(String command)
public void setRedeployScanPeriod(long period)
public void setRedeployGracePeriod(long period)
public void setRedeployStopWaitingTime(long period)
public void setUp(ExecutionContext context) throws CLIException
setUp in interface CommandsetUp in class DefaultCommandcontext - - the execution contextCLIException - - validation failedpublic boolean isClustered()
isClustered in class BareCommandcluster option or the ha option are enabled. Also true when a custom
launcher modifies the Vert.x options to set `clustered` to truepublic boolean getHA()
getHA in class BareCommandtrue.public void run()
run in interface Commandrun in class BareCommandprotected void initializeRedeployment()
Watcher instance is responsible for monitoring files and triggering the
redeployment.protected void shutdownRedeployment()
protected void stopBackgroundApplication(Handler<Void> onCompletion)
onCompletion - an optional on-completion handler. If set it must be invoked at the end of this method.protected void startAsBackgroundApplication(Handler<Void> onCompletion)
onCompletion - an optional on-completion handler. If set it must be invoked at the end of this method.protected void deploy()
protected JsonObject getConfiguration()
protected void beforeDeployingVerticle(DeploymentOptions deploymentOptions)
protected void afterConfigParsed(JsonObject config)
protected void beforeStoppingVertx(Vertx vertx)
protected void afterStoppingVertx()
Copyright © 2020. All rights reserved.