io.vertx.kotlin.core.VertxOptions.kt Maven / Gradle / Ivy
/*
* Copyright 2019 Red Hat, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
package io.vertx.kotlin.core
import io.vertx.core.VertxOptions
import io.vertx.core.dns.AddressResolverOptions
import io.vertx.core.eventbus.EventBusOptions
import io.vertx.core.file.FileSystemOptions
import io.vertx.core.metrics.MetricsOptions
import io.vertx.core.tracing.TracingOptions
import java.util.concurrent.TimeUnit
/**
* A function providing a DSL for building [io.vertx.core.VertxOptions] objects.
*
* Instances of this class are used to configure [io.vertx.core.Vertx] instances.
*
* @param eventLoopPoolSize Set the number of event loop threads to be used by the Vert.x instance.
* @param workerPoolSize Set the maximum number of worker threads to be used by the Vert.x instance.
* @param blockedThreadCheckInterval Sets the value of blocked thread check period, in [io.vertx.core.VertxOptions]. The default value of [io.vertx.core.VertxOptions] is
* @param maxEventLoopExecuteTime Sets the value of max event loop execute time, in [io.vertx.core.VertxOptions].
The default value of [io.vertx.core.VertxOptions]is
* @param maxWorkerExecuteTime Sets the value of max worker execute time, in [io.vertx.core.VertxOptions].
The default value of [io.vertx.core.VertxOptions] is
* @param internalBlockingPoolSize Set the value of internal blocking pool size
* @param haEnabled Set whether HA will be enabled on the Vert.x instance.
* @param quorumSize Set the quorum size to be used when HA is enabled.
* @param haGroup Set the HA group to be used when HA is enabled.
* @param metricsOptions Set the metrics options
* @param fileSystemOptions Set the file system options
* @param warningExceptionTime Set the threshold value above this, the blocked warning contains a stack trace. in [io.vertx.core.VertxOptions]. The default value of [io.vertx.core.VertxOptions] is
* @param eventBusOptions Sets the event bus configuration to configure the host, port, ssl...
* @param addressResolverOptions Sets the address resolver configuration to configure resolving DNS servers, cache TTL, etc...
* @param preferNativeTransport Set whether to prefer the native transport to the NIO transport.
* @param maxEventLoopExecuteTimeUnit Set the time unit of maxEventLoopExecuteTime
.
* @param maxWorkerExecuteTimeUnit Set the time unit of maxWorkerExecuteTime
.
* @param warningExceptionTimeUnit Set the time unit of warningExceptionTime
.
* @param blockedThreadCheckIntervalUnit Set the time unit of blockedThreadCheckInterval
.
* @param tracingOptions Set the tracing options
* @param disableTCCL Configures whether Vert.x sets the [io.vertx.core.Context] classloader as the thread context classloader on actions executed on that [io.vertx.core.Context]. When a [io.vertx.core.Context] is created the current thread classloader is captured and associated with this classloader. Likewise when a Verticle is created, the Verticle's [io.vertx.core.Context] classloader is set to the current thread classloader unless this classloader is overriden by [io.vertx.core.DeploymentOptions]. This setting overrides the (legacy) system property vertx.disableTCCL
and provides control at the Vertx instance level.
* @param useDaemonThread Mark the vertx thread as daemon thread or user thread.
For keeping the old behavior, the default value is false
instead of null
.
*
*
* NOTE: This function has been automatically generated from the [io.vertx.core.VertxOptions original] using Vert.x codegen.
*/
fun vertxOptionsOf(
eventLoopPoolSize: Int? = null,
workerPoolSize: Int? = null,
blockedThreadCheckInterval: Long? = null,
maxEventLoopExecuteTime: Long? = null,
maxWorkerExecuteTime: Long? = null,
internalBlockingPoolSize: Int? = null,
haEnabled: Boolean? = null,
quorumSize: Int? = null,
haGroup: String? = null,
metricsOptions: io.vertx.core.metrics.MetricsOptions? = null,
fileSystemOptions: io.vertx.core.file.FileSystemOptions? = null,
warningExceptionTime: Long? = null,
eventBusOptions: io.vertx.core.eventbus.EventBusOptions? = null,
addressResolverOptions: io.vertx.core.dns.AddressResolverOptions? = null,
preferNativeTransport: Boolean? = null,
maxEventLoopExecuteTimeUnit: TimeUnit? = null,
maxWorkerExecuteTimeUnit: TimeUnit? = null,
warningExceptionTimeUnit: TimeUnit? = null,
blockedThreadCheckIntervalUnit: TimeUnit? = null,
tracingOptions: io.vertx.core.tracing.TracingOptions? = null,
disableTCCL: Boolean? = null,
useDaemonThread: Boolean? = null): VertxOptions = io.vertx.core.VertxOptions().apply {
if (eventLoopPoolSize != null) {
this.setEventLoopPoolSize(eventLoopPoolSize)
}
if (workerPoolSize != null) {
this.setWorkerPoolSize(workerPoolSize)
}
if (blockedThreadCheckInterval != null) {
this.setBlockedThreadCheckInterval(blockedThreadCheckInterval)
}
if (maxEventLoopExecuteTime != null) {
this.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime)
}
if (maxWorkerExecuteTime != null) {
this.setMaxWorkerExecuteTime(maxWorkerExecuteTime)
}
if (internalBlockingPoolSize != null) {
this.setInternalBlockingPoolSize(internalBlockingPoolSize)
}
if (haEnabled != null) {
this.setHAEnabled(haEnabled)
}
if (quorumSize != null) {
this.setQuorumSize(quorumSize)
}
if (haGroup != null) {
this.setHAGroup(haGroup)
}
if (metricsOptions != null) {
this.setMetricsOptions(metricsOptions)
}
if (fileSystemOptions != null) {
this.setFileSystemOptions(fileSystemOptions)
}
if (warningExceptionTime != null) {
this.setWarningExceptionTime(warningExceptionTime)
}
if (eventBusOptions != null) {
this.setEventBusOptions(eventBusOptions)
}
if (addressResolverOptions != null) {
this.setAddressResolverOptions(addressResolverOptions)
}
if (preferNativeTransport != null) {
this.setPreferNativeTransport(preferNativeTransport)
}
if (maxEventLoopExecuteTimeUnit != null) {
this.setMaxEventLoopExecuteTimeUnit(maxEventLoopExecuteTimeUnit)
}
if (maxWorkerExecuteTimeUnit != null) {
this.setMaxWorkerExecuteTimeUnit(maxWorkerExecuteTimeUnit)
}
if (warningExceptionTimeUnit != null) {
this.setWarningExceptionTimeUnit(warningExceptionTimeUnit)
}
if (blockedThreadCheckIntervalUnit != null) {
this.setBlockedThreadCheckIntervalUnit(blockedThreadCheckIntervalUnit)
}
if (tracingOptions != null) {
this.setTracingOptions(tracingOptions)
}
if (disableTCCL != null) {
this.setDisableTCCL(disableTCCL)
}
if (useDaemonThread != null) {
this.setUseDaemonThread(useDaemonThread)
}
}