Class DeploymentOptions
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final intstatic final ThreadingModelstatic final boolean -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCopy constructorDeploymentOptions(JsonObject json) Constructor for creating a instance from JSON -
Method Summary
Modifier and TypeMethodDescriptionGet the JSON configuration that will be passed to the verticle(s) when deployed.intGet the number of instances that should be deployed.longGet the value of max worker execute time, inmaxWorkerExecuteTimeUnit.When the verticle does not use anamed worker pool, this option has no effect.Which threading model the verticle(s) should use?intGet the maximum number of worker threads to be used by the worker pool when the verticle is deployed with asetWorkerPoolName(String).booleanisHa()Will the verticle(s) be deployed as HA (highly available) ?setClassLoader(ClassLoader classLoader) Set the classloader to use for deploying the Verticle.setConfig(JsonObject config) Set the JSON configuration that will be passed to the verticle(s) when it's deployedsetHa(boolean ha) Set whether the verticle(s) will be deployed as HA.setInstances(int instances) Set the number of instances that should be deployed.setMaxWorkerExecuteTime(long maxWorkerExecuteTime) Sets the value of max worker execute time, inmaxWorkerExecuteTimeUnit.setMaxWorkerExecuteTimeUnit(TimeUnit maxWorkerExecuteTimeUnit) Set the time unit ofmaxWorkerExecuteTimesetThreadingModel(ThreadingModel threadingModel) Set the verticle(s) verticle(s) threading model, e.g. a worker or a virtual thread verticlesetWorkerPoolName(String workerPoolName) Set the worker pool name to use for this verticle.setWorkerPoolSize(int workerPoolSize) Set the maximum number of worker threads to be used by the Vert.x instance.toJson()Convert this to JSON
-
Field Details
-
DEFAULT_MODE
-
DEFAULT_WORKER
public static final boolean DEFAULT_WORKER- See Also:
-
DEFAULT_HA
public static final boolean DEFAULT_HA- See Also:
-
DEFAULT_INSTANCES
public static final int DEFAULT_INSTANCES- See Also:
-
-
Constructor Details
-
DeploymentOptions
public DeploymentOptions()Default constructor -
DeploymentOptions
Copy constructor- Parameters:
other- the instance to copy
-
DeploymentOptions
Constructor for creating a instance from JSON- Parameters:
json- the JSON
-
-
Method Details
-
getConfig
Get the JSON configuration that will be passed to the verticle(s) when deployed.- Returns:
- the JSON config
-
setConfig
Set the JSON configuration that will be passed to the verticle(s) when it's deployed- Parameters:
config- the JSON config- Returns:
- a reference to this, so the API can be used fluently
-
getThreadingModel
Which threading model the verticle(s) should use?- Returns:
- the verticle threading model
-
setThreadingModel
Set the verticle(s) verticle(s) threading model, e.g. a worker or a virtual thread verticle- Parameters:
threadingModel- the threading model- Returns:
- a reference to this, so the API can be used fluently
-
isHa
public boolean isHa()Will the verticle(s) be deployed as HA (highly available) ?- Returns:
- true if HA, false otherwise
-
setHa
Set whether the verticle(s) will be deployed as HA.- Parameters:
ha- true if to be deployed as HA, false otherwise- Returns:
- a reference to this, so the API can be used fluently
-
getInstances
public int getInstances()Get the number of instances that should be deployed.- Returns:
- the number of instances
-
setInstances
Set the number of instances that should be deployed.- Parameters:
instances- the number of instances- Returns:
- a reference to this, so the API can be used fluently
-
getWorkerPoolName
- Returns:
- the worker pool name
-
setWorkerPoolName
Set the worker pool name to use for this verticle. When no name is set, the Vert.x worker pool will be used, when a name is set, the verticle will use a named worker pool.- Parameters:
workerPoolName- the worker pool name- Returns:
- a reference to this, so the API can be used fluently
-
getWorkerPoolSize
public int getWorkerPoolSize()Get the maximum number of worker threads to be used by the worker pool when the verticle is deployed with asetWorkerPoolName(String).Worker threads are used for running blocking code and worker verticles.
When the verticle does not use a
named worker pool, this option has no effect.- Returns:
- the maximum number of worker threads
-
setWorkerPoolSize
Set the maximum number of worker threads to be used by the Vert.x instance.When the verticle does not use a
named worker pool, this option has no effect.- Parameters:
workerPoolSize- the number of threads- Returns:
- a reference to this, so the API can be used fluently
-
getMaxWorkerExecuteTime
public long getMaxWorkerExecuteTime()Get the value of max worker execute time, inmaxWorkerExecuteTimeUnit.Vert.x will automatically log a warning if it detects that worker threads haven't returned within this time.
This can be used to detect where the user is blocking a worker thread for too long. Although worker threads can be blocked longer than event loop threads, they shouldn't be blocked for long periods of time.
When the verticle does not use a
named worker pool, this option has no effect.- Returns:
- The value of max worker execute time, the default value of
setMaxWorkerExecuteTimeUnit(TimeUnit)maxWorkerExecuteTimeUnitisTimeUnit.NANOSECONDS
-
setMaxWorkerExecuteTime
Sets the value of max worker execute time, inmaxWorkerExecuteTimeUnit.The default value of
maxWorkerExecuteTimeUnitisTimeUnit.NANOSECONDSWhen the verticle does not use a
named worker pool, this option has no effect.- Parameters:
maxWorkerExecuteTime- the value of max worker execute time, in inmaxWorkerExecuteTimeUnit.- Returns:
- a reference to this, so the API can be used fluently
-
getMaxWorkerExecuteTimeUnit
When the verticle does not use anamed worker pool, this option has no effect.- Returns:
- the time unit of
maxWorkerExecuteTime
-
setMaxWorkerExecuteTimeUnit
Set the time unit ofmaxWorkerExecuteTimeWhen the verticle does not use a
named worker pool, this option has no effect.- Parameters:
maxWorkerExecuteTimeUnit- the time unit ofmaxWorkerExecuteTime- Returns:
- a reference to this, so the API can be used fluently
-
getClassLoader
- Returns:
- the classloader used for deploying the Verticle
-
setClassLoader
Set the classloader to use for deploying the Verticle.The
VerticleFactorywill use this classloader for creating the Verticle and the VerticleContextwill set this classloader as context classloader for the tasks execution on context.By default no classloader is required and the deployment will use the current thread context classloader.
- Parameters:
classLoader- the loader to use- Returns:
- a reference to this, so the API can be used fluently
-
toJson
-