Top Description Fields Constructors Methods
io.vertx.core

public Class DeploymentOptions

extends Object
Class Inheritance
Annotations
@DataObject
@JsonGen
publicConverter:false
Imports
io.vertx.codegen.annotations.DataObject, .GenIgnore, io.vertx.codegen.json.annotations.JsonGen, io.vertx.core.json.JsonArray, .JsonObject, java.util.ArrayList, .List, java.util.concurrent.TimeUnit

Options for configuring a verticle deployment.

Author
Tim Fox

Field Summary

Modifier and TypeField and Description
private ClassLoader
private JsonObject
config

References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.
public static final boolean
public static final int
public static final ThreadingModel
public static final boolean
private List<String>
private boolean
private int
private List<String>
private String
private long
private TimeUnit
private ThreadingModel
private String
private int

Constructor Summary

AccessConstructor and Description
public
DeploymentOptions()

Default constructor

public
DeploymentOptions(DeploymentOptions
the instance to copy
other
)

Copy constructor

public
DeploymentOptions(JsonObject
the JSON
json
)
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor for creating a instance from JSON

Method Summary

Modifier and TypeMethod and Description
public void
checkIsolationNotDefined()

Throw IllegalArgumentException when loader isolation configuration has been defined.

public ClassLoader

Returns:

the classloader used for deploying the Verticle
getClassLoader
()

public JsonObject

Returns:

the JSON config
getConfig
()
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Get the JSON configuration that will be passed to the verticle(s) when deployed.

public List<String>

Returns:

any extra classpath
getExtraClasspath
()
Deprecated

Get any extra classpath to be used when deploying the verticle.

public int

Returns:

the number of instances
getInstances
()

Get the number of instances that should be deployed.

public List<String>

Returns:

the list of isolated classes
getIsolatedClasses
()
Deprecated

Get the list of isolated class names, the names can be a Java class fully qualified name such as 'com.mycompany.myproject.engine.MyClass' or a wildcard matching such as `com.mycompany.myproject.*`.

public String

Returns:

the isolation group
getIsolationGroup
()
Deprecated

Get the isolation group that will be used when deploying the verticle(s)

Important Note

this feature is removed when running with Java 11 or above.

public long

Returns:

The value of max worker execute time, the default value of DeploymentOptions#setMaxWorkerExecuteTimeUnit maxWorkerExecuteTimeUnit is TimeUnit#NANOSECONDS
getMaxWorkerExecuteTime
()

Get the value of max worker execute time, in maxWorkerExecuteTimeUnit.

public TimeUnit

Returns:

the time unit of maxWorkerExecuteTime
getMaxWorkerExecuteTimeUnit
()

When the verticle does not use a named worker pool, this option has no effect.

public ThreadingModel

Returns:

the verticle threading model
getThreadingModel
()

Which threading model the verticle(s) should use?

public String

Returns:

the worker pool name
getWorkerPoolName
()

public int

Returns:

the maximum number of worker threads
getWorkerPoolSize
()

Get the maximum number of worker threads to be used by the worker pool when the verticle is deployed with a setWorkerPoolName.

public boolean

Returns:

true if HA, false otherwise
isHa
()

Will the verticle(s) be deployed as HA (highly available) ?

public boolean

Returns:

true if will be deployed as worker, false otherwise
isWorker
()
Deprecated instead use getThreadingModel()

Should the verticle(s) be deployed as a worker verticle?

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setClassLoader
(ClassLoader
the loader to use
classLoader
)

Set the classloader to use for deploying the Verticle.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setConfig
(JsonObject
the JSON config
config
)
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Set the JSON configuration that will be passed to the verticle(s) when it's deployed

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setExtraClasspath
(List<String> extraClasspath)
Deprecated

Set any extra classpath to be used when deploying the verticle.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setHa
(boolean
true if to be deployed as HA, false otherwise
ha
)

Set whether the verticle(s) will be deployed as HA.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setInstances
(int
the number of instances
instances
)

Set the number of instances that should be deployed.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setIsolatedClasses
(List<String>
the list of isolated class names
isolatedClasses
)
Deprecated

Set the isolated class names.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setIsolationGroup
(String
- the isolation group
isolationGroup
)
Deprecated

Set the isolation group that will be used when deploying the verticle(s)

Important Note

this feature is removed when running with Java 11 or above.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setMaxWorkerExecuteTime
(long
the value of max worker execute time, in in maxWorkerExecuteTimeUnit.
maxWorkerExecuteTime
)

Sets the value of max worker execute time, in maxWorkerExecuteTimeUnit.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setMaxWorkerExecuteTimeUnit
(TimeUnit
the time unit of maxWorkerExecuteTime
maxWorkerExecuteTimeUnit
)

Set the time unit of maxWorkerExecuteTime

When the verticle does not use a named worker pool, this option has no effect.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setThreadingModel
(ThreadingModel
the threading model
threadingModel
)

Set the verticle(s) verticle(s) threading model, e.g. a worker or a virtual thread verticle

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setWorker
(boolean
true for worker, false force event-loop
worker
)
Deprecated instead use setThreadingModel(ThreadingModel)

Set whether the verticle(s) should be deployed as a worker verticle

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setWorkerPoolName
(String
the worker pool name
workerPoolName
)

Set the worker pool name to use for this verticle.

public DeploymentOptions

Returns:

a reference to this, so the API can be used fluently
setWorkerPoolSize
(int
the number of threads
workerPoolSize
)

Set the maximum number of worker threads to be used by the Vert.x instance.

public JsonObject

Returns:

the JSON
toJson
()
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Convert this to JSON

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderback to summary
private ClassLoader classLoader
configback to summary
private JsonObject config

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

DEFAULT_HAback to summary
public static final boolean DEFAULT_HA
DEFAULT_INSTANCESback to summary
public static final int DEFAULT_INSTANCES
DEFAULT_MODEback to summary
public static final ThreadingModel DEFAULT_MODE
DEFAULT_WORKERback to summary
public static final boolean DEFAULT_WORKER
extraClasspathback to summary
private List<String> extraClasspath
haback to summary
private boolean ha
instancesback to summary
private int instances
isolatedClassesback to summary
private List<String> isolatedClasses
isolationGroupback to summary
private String isolationGroup
maxWorkerExecuteTimeback to summary
private long maxWorkerExecuteTime
maxWorkerExecuteTimeUnitback to summary
private TimeUnit maxWorkerExecuteTimeUnit
threadingModelback to summary
private ThreadingModel threadingModel
workerPoolNameback to summary
private String workerPoolName
workerPoolSizeback to summary
private int workerPoolSize

Constructor Detail

DeploymentOptionsback to summary
public DeploymentOptions()

Default constructor

DeploymentOptionsback to summary
public DeploymentOptions(DeploymentOptions other)

Copy constructor

Parameters
other:DeploymentOptions

the instance to copy

DeploymentOptionsback to summary
public DeploymentOptions(JsonObject json)

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructor for creating a instance from JSON

Parameters
json:JsonObject

the JSON

Method Detail

checkIsolationNotDefinedback to summary
public void checkIsolationNotDefined()

Throw IllegalArgumentException when loader isolation configuration has been defined.

getClassLoaderback to summary
public ClassLoader getClassLoader()
Returns:ClassLoader

the classloader used for deploying the Verticle

getConfigback to summary
public JsonObject getConfig()

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Get the JSON configuration that will be passed to the verticle(s) when deployed.

Returns:JsonObject

the JSON config

getExtraClasspathback to summary
public List<String> getExtraClasspath()

Deprecated

Get any extra classpath to be used when deploying the verticle.

Ignored if no isolation group is set.

Important Note

this feature is removed when running with Java 11 or above.

Returns:List<String>

any extra classpath

Annotations
@GenIgnore
@Deprecated
getInstancesback to summary
public int getInstances()

Get the number of instances that should be deployed.

Returns:int

the number of instances

getIsolatedClassesback to summary
public List<String> getIsolatedClasses()

Deprecated

Get the list of isolated class names, the names can be a Java class fully qualified name such as 'com.mycompany.myproject.engine.MyClass' or a wildcard matching such as `com.mycompany.myproject.*`.

Important Note

this feature is removed when running with Java 11 or above.

Returns:List<String>

the list of isolated classes

Annotations
@GenIgnore
@Deprecated
getIsolationGroupback to summary
public String getIsolationGroup()

Deprecated

Get the isolation group that will be used when deploying the verticle(s)

Important Note

this feature is removed when running with Java 11 or above.

Returns:String

the isolation group

Annotations
@GenIgnore
@Deprecated
getMaxWorkerExecuteTimeback to summary
public long getMaxWorkerExecuteTime()

Get the value of max worker execute time, in 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.

Returns:long

The value of max worker execute time, the default value of DeploymentOptions#setMaxWorkerExecuteTimeUnit maxWorkerExecuteTimeUnit is TimeUnit#NANOSECONDS

getMaxWorkerExecuteTimeUnitback to summary
public TimeUnit getMaxWorkerExecuteTimeUnit()

When the verticle does not use a named worker pool, this option has no effect.

Returns:TimeUnit

the time unit of maxWorkerExecuteTime

getThreadingModelback to summary
public ThreadingModel getThreadingModel()

Which threading model the verticle(s) should use?

Returns:ThreadingModel

the verticle threading model

getWorkerPoolNameback to summary
public String getWorkerPoolName()
Returns:String

the worker pool name

getWorkerPoolSizeback to summary
public int getWorkerPoolSize()

Get the maximum number of worker threads to be used by the worker pool when the verticle is deployed with a setWorkerPoolName.

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:int

the maximum number of worker threads

isHaback to summary
public boolean isHa()

Will the verticle(s) be deployed as HA (highly available) ?

Returns:boolean

true if HA, false otherwise

isWorkerback to summary
public boolean isWorker()

Deprecated

instead use getThreadingModel()

Should the verticle(s) be deployed as a worker verticle?

Returns:boolean

true if will be deployed as worker, false otherwise

Annotations
@Deprecated
setClassLoaderback to summary
public DeploymentOptions setClassLoader(ClassLoader classLoader)

Set the classloader to use for deploying the Verticle.

The VerticleFactory will use this classloader for creating the Verticle and the Verticle io.vertx.core.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.

Parameters
classLoader:ClassLoader

the loader to use

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setConfigback to summary
public DeploymentOptions setConfig(JsonObject config)

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Set the JSON configuration that will be passed to the verticle(s) when it's deployed

Parameters
config:JsonObject

the JSON config

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setExtraClasspathback to summary
public DeploymentOptions setExtraClasspath(List<String> extraClasspath)

Deprecated

Set any extra classpath to be used when deploying the verticle.

Ignored if no isolation group is set.

Important Note

this feature is removed when running with Java 11 or above.

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

Annotations
@GenIgnore
@Deprecated
setHaback to summary
public DeploymentOptions setHa(boolean ha)

Set whether the verticle(s) will be deployed as HA.

Parameters
ha:boolean

true if to be deployed as HA, false otherwise

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setInstancesback to summary
public DeploymentOptions setInstances(int instances)

Set the number of instances that should be deployed.

Parameters
instances:int

the number of instances

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setIsolatedClassesback to summary
public DeploymentOptions setIsolatedClasses(List<String> isolatedClasses)

Deprecated

Set the isolated class names.

Important Note

this feature is removed when running with Java 11 or above.

Parameters
isolatedClasses:List<String>

the list of isolated class names

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

Annotations
@GenIgnore
@Deprecated
setIsolationGroupback to summary
public DeploymentOptions setIsolationGroup(String isolationGroup)

Deprecated

Set the isolation group that will be used when deploying the verticle(s)

Important Note

this feature is removed when running with Java 11 or above.

Parameters
isolationGroup:String

- the isolation group

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

Annotations
@GenIgnore
@Deprecated
setMaxWorkerExecuteTimeback to summary
public DeploymentOptions setMaxWorkerExecuteTime(long maxWorkerExecuteTime)

Sets the value of max worker execute time, in maxWorkerExecuteTimeUnit.

The default value of maxWorkerExecuteTimeUnit is TimeUnit#NANOSECONDS

When the verticle does not use a named worker pool, this option has no effect.

Parameters
maxWorkerExecuteTime:long

the value of max worker execute time, in in maxWorkerExecuteTimeUnit.

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setMaxWorkerExecuteTimeUnitback to summary
public DeploymentOptions setMaxWorkerExecuteTimeUnit(TimeUnit maxWorkerExecuteTimeUnit)

Set the time unit of maxWorkerExecuteTime

When the verticle does not use a named worker pool, this option has no effect.

Parameters
maxWorkerExecuteTimeUnit:TimeUnit

the time unit of maxWorkerExecuteTime

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setThreadingModelback to summary
public DeploymentOptions setThreadingModel(ThreadingModel threadingModel)

Set the verticle(s) verticle(s) threading model, e.g. a worker or a virtual thread verticle

Parameters
threadingModel:ThreadingModel

the threading model

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setWorkerback to summary
public DeploymentOptions setWorker(boolean worker)

Deprecated

instead use setThreadingModel(ThreadingModel)

Set whether the verticle(s) should be deployed as a worker verticle

Parameters
worker:boolean

true for worker, false force event-loop

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

Annotations
@Deprecated
setWorkerPoolNameback to summary
public DeploymentOptions setWorkerPoolName(String workerPoolName)

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:String

the worker pool name

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

setWorkerPoolSizeback to summary
public DeploymentOptions setWorkerPoolSize(int workerPoolSize)

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:int

the number of threads

Returns:DeploymentOptions

a reference to this, so the API can be used fluently

toJsonback to summary
public JsonObject toJson()

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Convert this to JSON

Returns:JsonObject

the JSON