Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_HA |
static int |
DEFAULT_INSTANCES |
static boolean |
DEFAULT_WORKER |
Constructor and Description |
---|
DeploymentOptions()
Default constructor
|
DeploymentOptions(DeploymentOptions other)
Copy constructor
|
DeploymentOptions(JsonObject json)
Constructor for creating a instance from JSON
|
Modifier and Type | Method and Description |
---|---|
void |
checkIsolationNotDefined()
Throw
IllegalArgumentException when loader isolation configuration has been defined. |
ClassLoader |
getClassLoader() |
JsonObject |
getConfig()
Get the JSON configuration that will be passed to the verticle(s) when deployed.
|
List<String> |
getExtraClasspath()
Deprecated.
|
int |
getInstances()
Get the number of instances that should be deployed.
|
List<String> |
getIsolatedClasses()
Deprecated.
|
String |
getIsolationGroup()
Deprecated.
|
long |
getMaxWorkerExecuteTime()
Get the value of max worker execute time, in
maxWorkerExecuteTimeUnit . |
TimeUnit |
getMaxWorkerExecuteTimeUnit()
When the verticle does not use a
named worker pool , this option has no effect. |
String |
getWorkerPoolName() |
int |
getWorkerPoolSize()
Get the maximum number of worker threads to be used by the worker pool when the verticle is deployed
with a
setWorkerPoolName(java.lang.String) . |
boolean |
isHa()
Will the verticle(s) be deployed as HA (highly available) ?
|
boolean |
isWorker()
Should the verticle(s) be deployed as a worker verticle?
|
DeploymentOptions |
setClassLoader(ClassLoader classLoader)
Set the classloader to use for deploying the Verticle.
|
DeploymentOptions |
setConfig(JsonObject config)
Set the JSON configuration that will be passed to the verticle(s) when it's deployed
|
DeploymentOptions |
setExtraClasspath(List<String> extraClasspath)
Deprecated.
|
DeploymentOptions |
setHa(boolean ha)
Set whether the verticle(s) will be deployed as HA.
|
DeploymentOptions |
setInstances(int instances)
Set the number of instances that should be deployed.
|
DeploymentOptions |
setIsolatedClasses(List<String> isolatedClasses)
Deprecated.
|
DeploymentOptions |
setIsolationGroup(String isolationGroup)
Deprecated.
|
DeploymentOptions |
setMaxWorkerExecuteTime(long maxWorkerExecuteTime)
Sets the value of max worker execute time, in
maxWorkerExecuteTimeUnit . |
DeploymentOptions |
setMaxWorkerExecuteTimeUnit(TimeUnit maxWorkerExecuteTimeUnit)
Set the time unit of
maxWorkerExecuteTime |
DeploymentOptions |
setWorker(boolean worker)
Set whether the verticle(s) should be deployed as a worker verticle
|
DeploymentOptions |
setWorkerPoolName(String workerPoolName)
Set the worker pool name to use for this verticle.
|
DeploymentOptions |
setWorkerPoolSize(int workerPoolSize)
Set the maximum number of worker threads to be used by the Vert.x instance.
|
JsonObject |
toJson()
Convert this to JSON
|
public static final boolean DEFAULT_WORKER
public static final boolean DEFAULT_HA
public static final int DEFAULT_INSTANCES
public DeploymentOptions()
public DeploymentOptions(DeploymentOptions other)
other
- the instance to copypublic DeploymentOptions(JsonObject json)
json
- the JSONpublic JsonObject getConfig()
public DeploymentOptions setConfig(JsonObject config)
config
- the JSON configpublic boolean isWorker()
public DeploymentOptions setWorker(boolean worker)
worker
- true for worker, false otherwise@Deprecated public String getIsolationGroup()
@Deprecated public DeploymentOptions setIsolationGroup(String isolationGroup)
isolationGroup
- - the isolation grouppublic boolean isHa()
public DeploymentOptions setHa(boolean ha)
ha
- true if to be deployed as HA, false otherwise@Deprecated public List<String> getExtraClasspath()
Ignored if no isolation group is set.
IMPORTANT this feature is removed when running with Java 11 or above.
@Deprecated public DeploymentOptions setExtraClasspath(List<String> extraClasspath)
Ignored if no isolation group is set.
IMPORTANT this feature is removed when running with Java 11 or above.
public int getInstances()
public DeploymentOptions setInstances(int instances)
instances
- the number of instances@Deprecated public List<String> getIsolatedClasses()
@Deprecated public DeploymentOptions setIsolatedClasses(List<String> isolatedClasses)
isolatedClasses
- the list of isolated class namespublic String getWorkerPoolName()
public DeploymentOptions setWorkerPoolName(String workerPoolName)
workerPoolName
- the worker pool namepublic int getWorkerPoolSize()
setWorkerPoolName(java.lang.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.
public DeploymentOptions setWorkerPoolSize(int workerPoolSize)
When the verticle does not use a named worker pool
, this option has no effect.
workerPoolSize
- the number of threadspublic long getMaxWorkerExecuteTime()
maxWorkerExecuteTimeUnit
.
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.
setMaxWorkerExecuteTimeUnit(java.util.concurrent.TimeUnit)
maxWorkerExecuteTimeUnit
is TimeUnit.NANOSECONDS
public DeploymentOptions setMaxWorkerExecuteTime(long maxWorkerExecuteTime)
maxWorkerExecuteTimeUnit
.
The default value of maxWorkerExecuteTimeUnit
is TimeUnit.NANOSECONDS
When the verticle does not use a named worker pool
, this option has no effect.
maxWorkerExecuteTime
- the value of max worker execute time, in in maxWorkerExecuteTimeUnit
.public TimeUnit getMaxWorkerExecuteTimeUnit()
named worker pool
, this option has no effect.maxWorkerExecuteTime
public DeploymentOptions setMaxWorkerExecuteTimeUnit(TimeUnit maxWorkerExecuteTimeUnit)
maxWorkerExecuteTime
When the verticle does not use a named worker pool
, this option has no effect.
maxWorkerExecuteTimeUnit
- the time unit of maxWorkerExecuteTime
public ClassLoader getClassLoader()
public DeploymentOptions setClassLoader(ClassLoader classLoader)
The VerticleFactory
will use this classloader for creating the Verticle
and the Verticle Context
will 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.
classLoader
- the loader to usepublic void checkIsolationNotDefined()
IllegalArgumentException
when loader isolation configuration has been defined.public JsonObject toJson()
Copyright © 2024 Eclipse. All rights reserved.