Top Description Methods
io.vertx.core.impl

public Interface VertxInternal

extends Vertx
Known Direct Implementers
io.vertx.core.impl.VertxWrapper, io.vertx.core.impl.VertxImpl
Imports
io.netty.channel.EventLoop, .EventLoopGroup, io.netty.resolver.AddressResolverGroup, io.vertx.codegen.annotations.CacheReturn, io.vertx.core.*, io.vertx.core.http.*, io.vertx.core.http.impl.HttpServerImpl, io.vertx.core.impl.btc.BlockedThreadChecker, io.vertx.core.impl.future.PromiseInternal, io.vertx.core.net.impl.NetServerImpl, .ServerID, .TCPServerBase, io.vertx.core.spi.context.storage.ContextLocal, io.vertx.core.spi.transport.Transport, io.vertx.core.spi.cluster.ClusterManager, io.vertx.core.spi.file.FileResolver, io.vertx.core.spi.metrics.VertxMetrics, io.vertx.core.spi.tracing.VertxTracer, java.io.File, java.net.InetAddress, .InetSocketAddress, java.util.List, .Map, java.util.concurrent.Callable, .Executor, .ExecutorService, .TimeUnit, java.util.function.Function

This interface provides services for vert.x core internal use only It is not part of the public API and should not be used by developers creating vert.x applications
Authors
Tim Fox, Julien Viet

Method Summary

Modifier and TypeMethod and Description
public void
public AddressResolver

Returns:

the address resolver
addressResolver
()

public BlockedThreadChecker
public CloseFuture
public List<ContextLocal<?>>

Returns:

an immutable list of this vertx instance context locals
contextLocals
()

public ContextInternal

Returns:

event loop context
createEventLoopContext
(Deployment deployment, CloseFuture closeFuture, WorkerPool workerPool, ClassLoader tccl)

public ContextInternal

Returns:

event loop context
createEventLoopContext
(EventLoop eventLoop, WorkerPool workerPool, ClassLoader tccl)

public ContextInternal

Returns:

event loop context
createEventLoopContext
()

public HttpClient

Returns:

the client
createHttpPoolClient
(HttpClientOptions
the http client options to use
clientOptions
,
PoolOptions
the pool options to use
poolOptions
,
CloseFuture
the close future
closeFuture
)

Create a HTTP/HTTPS client using the specified options and close future

public default <C> C
createSharedClient(String clientKey, String clientName, CloseFuture closeFuture, Function<CloseFuture, C> supplier)

public WorkerExecutorInternal
public WorkerExecutorInternal
public WorkerExecutorInternal
public WorkerExecutorInternal
createSharedWorkerExecutor(String
the name of the worker executor
name
,
int
the size of the pool
poolSize
,
long
the value of max worker execute time
maxExecuteTime
,
TimeUnit
the value of unit of max worker execute time
maxExecuteTimeUnit
)

Redeclares io.vertx.core.Vertx.createSharedWorkerExecutor.

Create a named worker executor, the executor should be closed when it's not needed anymore to release resources.

public WorkerPool
createSharedWorkerPool(String name, int poolSize, long maxExecuteTime, TimeUnit maxExecuteTimeUnit)

public ContextInternal

Returns:

virtual thread context
createVirtualThreadContext
(Deployment deployment, CloseFuture closeFuture, ClassLoader tccl)

public ContextInternal

Returns:

virtual thread context
createVirtualThreadContext
(EventLoop eventLoop, ClassLoader tccl)

public ContextInternal

Returns:

virtual thread context
createVirtualThreadContext
()

public WebSocketClient

Returns:

the client
createWebSocketClient
(WebSocketClientOptions
the options to use
options
,
CloseFuture
the close future
closeFuture
)

Create a WebSocket client using the specified options and close future

public ContextInternal

Returns:

worker context
createWorkerContext
(Deployment deployment, CloseFuture closeFuture, WorkerPool workerPool, ClassLoader tccl)

public ContextInternal

Returns:

worker context
createWorkerContext
(EventLoop eventLoop, WorkerPool workerPool, ClassLoader tccl)

public ContextInternal

Returns:

worker context
createWorkerContext
()

public default <T> void
executeBlockingInternal(Handler<Promise<T>> blockingCodeHandler, Handler<AsyncResult<T>> resultHandler)
Deprecated

Like executeBlocking(Handler, Handler) but using the internal worker thread pool.

public default <T> Future<T>
executeBlockingInternal(Callable<T> blockingCodeHandler)

public default <T> void
executeBlockingInternal(Handler<Promise<T>> blockingCodeHandler, boolean ordered, Handler<AsyncResult<T>> resultHandler)
Deprecated

public default <T> Future<T>
executeBlockingInternal(Callable<T> blockingCodeHandler, boolean ordered)

public void
failDuringFailover(boolean fail)

public void
public FileResolver

Returns:

the file resolver
fileResolver
()

public EventLoopGroup
public ClusterManager
public ContextInternal

Returns:

the context
getContext
()

Get the current context

public Deployment
getDeployment(String deploymentID)

public EventLoopGroup
public WorkerPool
public ContextInternal
getOrCreateContext()

Redeclares io.vertx.core.Vertx.getOrCreateContext.

Gets the current context, or creates one if there isn't one

public WorkerPool
public HAManager
public boolean
public boolean

Returns:

whether virtual threads are available
isVirtualThreadAvailable
()

public long
public TimeUnit
public VertxMetrics
public AddressResolverGroup<InetSocketAddress>

Returns:

the Netty AddressResolverGroup to use in a Netty Bootstrap
nettyAddressResolverGroup
()

public <T> PromiseInternal<T>

Returns:

a promise associated with the context returned by getOrCreateContext().
promise
()

public <T> PromiseInternal<T>

Returns:

a promise associated with the context returned by getOrCreateContext() or the handler if that handler is already an instance of PromiseInternal
promise
(Handler<AsyncResult<T>> handler)

public void
public void
resolveAddress(String
the hostname to resolve
hostname
,
Handler<AsyncResult<InetAddress>>
the result handler
resultHandler
)

Resolve an address (e.g. vertx.io into the first found A (IPv4) or AAAA (IPv6) record.

public File
resolveFile(String fileName)

public Map<ServerID, HttpServerImpl>
public Map<ServerID, NetServerImpl>
public <S extends TCPServerBase> Map<ServerID, S>
public void
public VertxTracer<I, O>

Returns:

the tracer
tracer
()

public Transport
public WorkerPool
Inherited from io.vertx.core.Vertx:
buildercancelTimerclosecloseclusteredVertxclusteredVertxcreateDatagramSocketcreateDatagramSocketcreateDnsClientcreateDnsClientcreateDnsClientcreateHttpClientcreateHttpClientcreateHttpClientcreateHttpClientcreateHttpServercreateHttpServercreateNetClientcreateNetClientcreateNetServercreateNetServercreateWebSocketClientcreateWebSocketClientcurrentContextdeploymentIDsdeployVerticledeployVerticledeployVerticledeployVerticledeployVerticledeployVerticledeployVerticledeployVerticledeployVerticledeployVerticledeployVerticledeployVerticleeventBusexceptionHandlerexceptionHandlerexecuteBlockingexecuteBlockingexecuteBlockingexecuteBlockingexecuteBlockingexecuteBlockingexecuteBlockingexecuteBlockingfileSystemhttpClientBuilderisClusteredisNativeTransportEnablednettyEventLoopGroupperiodicStreamperiodicStreamregisterVerticleFactoryrunOnContextsetPeriodicsetPeriodicsetTimersharedDatatimertimertimerStreamunavailableNativeTransportCauseundeployundeployunregisterVerticleFactoryverticleFactoriesvertxvertx

Method Detail

addCloseHookback to summary
public void addCloseHook(Closeable hook)
addressResolverback to summary
public AddressResolver addressResolver()
Returns:AddressResolver

the address resolver

blockedThreadCheckerback to summary
public BlockedThreadChecker blockedThreadChecker()
closeFutureback to summary
public CloseFuture closeFuture()
contextLocalsback to summary
public List<ContextLocal<?>> contextLocals()
Returns:List<ContextLocal<?>>

an immutable list of this vertx instance context locals

createEventLoopContextback to summary
public ContextInternal createEventLoopContext(Deployment deployment, CloseFuture closeFuture, WorkerPool workerPool, ClassLoader tccl)
Returns:ContextInternal

event loop context

createEventLoopContextback to summary
public ContextInternal createEventLoopContext(EventLoop eventLoop, WorkerPool workerPool, ClassLoader tccl)
Returns:ContextInternal

event loop context

createEventLoopContextback to summary
public ContextInternal createEventLoopContext()
Returns:ContextInternal

event loop context

createHttpPoolClientback to summary
public HttpClient createHttpPoolClient(HttpClientOptions clientOptions, PoolOptions poolOptions, CloseFuture closeFuture)

Create a HTTP/HTTPS client using the specified options and close future

Parameters
clientOptions:HttpClientOptions

the http client options to use

poolOptions:PoolOptions

the pool options to use

closeFuture:CloseFuture

the close future

Returns:HttpClient

the client

createSharedClientback to summary
public default <C> C createSharedClient(String clientKey, String clientName, CloseFuture closeFuture, Function<CloseFuture, C> supplier)
createSharedWorkerExecutorback to summary
public WorkerExecutorInternal createSharedWorkerExecutor(String name)

Redeclares io.vertx.core.Vertx.createSharedWorkerExecutor.

Doc from io.vertx.core.Vertx.createSharedWorkerExecutor.

Like createSharedWorkerExecutor(String, int) but with the VertxOptions#setWorkerPoolSize poolSize.

Annotations
@Override
createSharedWorkerExecutorback to summary
public WorkerExecutorInternal createSharedWorkerExecutor(String name, int poolSize)

Redeclares io.vertx.core.Vertx.createSharedWorkerExecutor.

Doc from io.vertx.core.Vertx.createSharedWorkerExecutor.

Like createSharedWorkerExecutor(String, int, long) but with the VertxOptions#setMaxWorkerExecuteTime maxExecuteTime.

Annotations
@Override
createSharedWorkerExecutorback to summary
public WorkerExecutorInternal createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime)

Redeclares io.vertx.core.Vertx.createSharedWorkerExecutor.

Doc from io.vertx.core.Vertx.createSharedWorkerExecutor.

Like createSharedWorkerExecutor(String, int, long, TimeUnit) but with the VertxOptions#setMaxWorkerExecuteTimeUnit(TimeUnit) maxExecuteTimeUnit.

Annotations
@Override
createSharedWorkerExecutorback to summary
public WorkerExecutorInternal createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime, TimeUnit maxExecuteTimeUnit)

Redeclares io.vertx.core.Vertx.createSharedWorkerExecutor.

Doc from io.vertx.core.Vertx.createSharedWorkerExecutor.

Create a named worker executor, the executor should be closed when it's not needed anymore to release resources.

This method can be called mutiple times with the same name. Executors with the same name will share the same worker pool. The worker pool size , max execute time and unit of max execute time are set when the worker pool is created and won't change after.

The worker pool is released when all the WorkerExecutor sharing the same name are closed.

Parameters
name:String

the name of the worker executor

poolSize:int

the size of the pool

maxExecuteTime:long

the value of max worker execute time

maxExecuteTimeUnit:TimeUnit

the value of unit of max worker execute time

Returns:WorkerExecutorInternal

the named worker executor

Annotations
@Override
createSharedWorkerPoolback to summary
public WorkerPool createSharedWorkerPool(String name, int poolSize, long maxExecuteTime, TimeUnit maxExecuteTimeUnit)
createVirtualThreadContextback to summary
public ContextInternal createVirtualThreadContext(Deployment deployment, CloseFuture closeFuture, ClassLoader tccl)
Returns:ContextInternal

virtual thread context

createVirtualThreadContextback to summary
public ContextInternal createVirtualThreadContext(EventLoop eventLoop, ClassLoader tccl)
Returns:ContextInternal

virtual thread context

createVirtualThreadContextback to summary
public ContextInternal createVirtualThreadContext()
Returns:ContextInternal

virtual thread context

createWebSocketClientback to summary
public WebSocketClient createWebSocketClient(WebSocketClientOptions options, CloseFuture closeFuture)

Create a WebSocket client using the specified options and close future

Parameters
options:WebSocketClientOptions

the options to use

closeFuture:CloseFuture

the close future

Returns:WebSocketClient

the client

createWorkerContextback to summary
public ContextInternal createWorkerContext(Deployment deployment, CloseFuture closeFuture, WorkerPool workerPool, ClassLoader tccl)
Returns:ContextInternal

worker context

createWorkerContextback to summary
public ContextInternal createWorkerContext(EventLoop eventLoop, WorkerPool workerPool, ClassLoader tccl)
Returns:ContextInternal

worker context

createWorkerContextback to summary
public ContextInternal createWorkerContext()
Returns:ContextInternal

worker context

executeBlockingInternalback to summary
public default <T> void executeBlockingInternal(Handler<Promise<T>> blockingCodeHandler, Handler<AsyncResult<T>> resultHandler)

Deprecated

Like executeBlocking(Handler, Handler) but using the internal worker thread pool.

Annotations
@Deprecated
executeBlockingInternalback to summary
public default <T> Future<T> executeBlockingInternal(Callable<T> blockingCodeHandler)
executeBlockingInternalback to summary
public default <T> void executeBlockingInternal(Handler<Promise<T>> blockingCodeHandler, boolean ordered, Handler<AsyncResult<T>> resultHandler)

Deprecated

Annotations
@Deprecated
executeBlockingInternalback to summary
public default <T> Future<T> executeBlockingInternal(Callable<T> blockingCodeHandler, boolean ordered)
failDuringFailoverback to summary
public void failDuringFailover(boolean fail)
failoverCompleteHandlerback to summary
public void failoverCompleteHandler(FailoverCompleteHandler failoverCompleteHandler)
fileResolverback to summary
public FileResolver fileResolver()
Returns:FileResolver

the file resolver

getAcceptorEventLoopGroupback to summary
public EventLoopGroup getAcceptorEventLoopGroup()
getClusterManagerback to summary
public ClusterManager getClusterManager()
getContextback to summary
public ContextInternal getContext()

Get the current context

Returns:ContextInternal

the context

getDeploymentback to summary
public Deployment getDeployment(String deploymentID)
getEventLoopGroupback to summary
public EventLoopGroup getEventLoopGroup()
getInternalWorkerPoolback to summary
public WorkerPool getInternalWorkerPool()
getOrCreateContextback to summary
public ContextInternal getOrCreateContext()

Redeclares io.vertx.core.Vertx.getOrCreateContext.

Doc from io.vertx.core.Vertx.getOrCreateContext.

Gets the current context, or creates one if there isn't one

Returns:ContextInternal

The current context (created if didn't exist)

Annotations
@Override
getWorkerPoolback to summary
public WorkerPool getWorkerPool()
haManagerback to summary
public HAManager haManager()
isKilledback to summary
public boolean isKilled()
isVirtualThreadAvailableback to summary
public boolean isVirtualThreadAvailable()
Returns:boolean

whether virtual threads are available

maxEventLoopExecTimeback to summary
public long maxEventLoopExecTime()
maxEventLoopExecTimeUnitback to summary
public TimeUnit maxEventLoopExecTimeUnit()
metricsSPIback to summary
public VertxMetrics metricsSPI()
nettyAddressResolverGroupback to summary
public AddressResolverGroup<InetSocketAddress> nettyAddressResolverGroup()
Returns:AddressResolverGroup<InetSocketAddress>

the Netty AddressResolverGroup to use in a Netty Bootstrap

promiseback to summary
public <T> PromiseInternal<T> promise()
Returns:PromiseInternal<T>

a promise associated with the context returned by getOrCreateContext().

promiseback to summary
public <T> PromiseInternal<T> promise(Handler<AsyncResult<T>> handler)
Returns:PromiseInternal<T>

a promise associated with the context returned by getOrCreateContext() or the handler if that handler is already an instance of PromiseInternal

removeCloseHookback to summary
public void removeCloseHook(Closeable hook)
resolveAddressback to summary
public void resolveAddress(String hostname, Handler<AsyncResult<InetAddress>> resultHandler)

Resolve an address (e.g. vertx.io into the first found A (IPv4) or AAAA (IPv6) record.

Parameters
hostname:String

the hostname to resolve

resultHandler:Handler<AsyncResult<InetAddress>>

the result handler

resolveFileback to summary
public File resolveFile(String fileName)
sharedHttpServersback to summary
public Map<ServerID, HttpServerImpl> sharedHttpServers()
sharedNetServersback to summary
public Map<ServerID, NetServerImpl> sharedNetServers()
sharedTCPServersback to summary
public <S extends TCPServerBase> Map<ServerID, S> sharedTCPServers(Class<S> type)
simulateKillback to summary
public void simulateKill()
tracerback to summary
public VertxTracer<I, O> tracer()
Returns:VertxTracer<I, O>

the tracer

transportback to summary
public Transport transport()
wrapWorkerPoolback to summary
public WorkerPool wrapWorkerPool(ExecutorService executor)