/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.vertx.rxjava.core;

import rx.Observable;
import rx.Single;
import io.vertx.rx.java.RxHelper;
import io.vertx.rx.java.WriteStreamSubscriber;
import io.vertx.rx.java.SingleOnSubscribeAdapter;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;

The entry point into the Vert.x Core API.

You use an instance of this class for functionality including:

  • Creating TCP clients and servers
  • Creating HTTP clients and servers
  • Creating DNS clients
  • Creating Datagram sockets
  • Setting and cancelling periodic and one-shot timers
  • Getting a reference to the event bus API
  • Getting a reference to the file system API
  • Getting a reference to the shared data API
  • Deploying and undeploying verticles

Most functionality in Vert.x core is fairly low level.

To create an instance of this class you can use the static factory methods: vertx, vertx and clusteredVertx.

Please see the user manual for more detailed usage information.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * The entry point into the Vert.x Core API. * <p> * You use an instance of this class for functionality including: * <ul> * <li>Creating TCP clients and servers</li> * <li>Creating HTTP clients and servers</li> * <li>Creating DNS clients</li> * <li>Creating Datagram sockets</li> * <li>Setting and cancelling periodic and one-shot timers</li> * <li>Getting a reference to the event bus API</li> * <li>Getting a reference to the file system API</li> * <li>Getting a reference to the shared data API</li> * <li>Deploying and undeploying verticles</li> * </ul> * <p> * Most functionality in Vert.x core is fairly low level. * <p> * To create an instance of this class you can use the static factory methods: {@link io.vertx.rxjava.core.Vertx#vertx}, * {@link io.vertx.rxjava.core.Vertx#vertx} and {@link io.vertx.rxjava.core.Vertx#clusteredVertx}. * <p> * Please see the user manual for more detailed usage information. * * <p/> * NOTE: This class has been automatically generated from the {@link io.vertx.core.Vertx original} non RX-ified interface using Vert.x codegen. */
@RxGen(io.vertx.core.Vertx.class) public class Vertx implements io.vertx.rxjava.core.metrics.Measured { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Vertx that = (Vertx) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final TypeArg<Vertx> __TYPE_ARG = new TypeArg<>( obj -> new Vertx((io.vertx.core.Vertx) obj), Vertx::getDelegate ); private final io.vertx.core.Vertx delegate; public Vertx(io.vertx.core.Vertx delegate) { this.delegate = delegate; } public Vertx(Object delegate) { this.delegate = (io.vertx.core.Vertx)delegate; } public io.vertx.core.Vertx getDelegate() { return delegate; }
Whether the metrics are enabled for this measured object
Returns:true if metrics are enabled
/** * Whether the metrics are enabled for this measured object * @return <code>true</code> if metrics are enabled */
public boolean isMetricsEnabled() { boolean ret = delegate.isMetricsEnabled(); return ret; }
Creates a non clustered instance using default options.
Returns:the instance
/** * Creates a non clustered instance using default options. * @return the instance */
public static io.vertx.rxjava.core.Vertx vertx() { io.vertx.rxjava.core.Vertx ret = io.vertx.rxjava.core.Vertx.newInstance((io.vertx.core.Vertx)io.vertx.core.Vertx.vertx()); return ret; }
Creates a non clustered instance using the specified options
Params:
  • options – the options to use
Returns:the instance
/** * Creates a non clustered instance using the specified options * @param options the options to use * @return the instance */
public static io.vertx.rxjava.core.Vertx vertx(io.vertx.core.VertxOptions options) { io.vertx.rxjava.core.Vertx ret = io.vertx.rxjava.core.Vertx.newInstance((io.vertx.core.Vertx)io.vertx.core.Vertx.vertx(options)); return ret; }
Creates a clustered instance using the specified options.

The instance is created asynchronously and the resultHandler is called with the result when it is ready.

Params:
  • options – the options to use
  • resultHandler – the result handler that will receive the result
/** * Creates a clustered instance using the specified options. * <p> * The instance is created asynchronously and the resultHandler is called with the result when it is ready. * @param options the options to use * @param resultHandler the result handler that will receive the result */
public static void clusteredVertx(io.vertx.core.VertxOptions options, Handler<AsyncResult<io.vertx.rxjava.core.Vertx>> resultHandler) { io.vertx.core.Vertx.clusteredVertx(options, new Handler<AsyncResult<io.vertx.core.Vertx>>() { public void handle(AsyncResult<io.vertx.core.Vertx> ar) { if (ar.succeeded()) { resultHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.Vertx.newInstance((io.vertx.core.Vertx)ar.result()))); } else { resultHandler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
Creates a clustered instance using the specified options.

The instance is created asynchronously and the resultHandler is called with the result when it is ready.

Params:
  • options – the options to use
/** * Creates a clustered instance using the specified options. * <p> * The instance is created asynchronously and the resultHandler is called with the result when it is ready. * @param options the options to use */
public static void clusteredVertx(io.vertx.core.VertxOptions options) { clusteredVertx(options, ar -> { }); }
Creates a clustered instance using the specified options.

The instance is created asynchronously and the resultHandler is called with the result when it is ready.

Params:
  • options – the options to use
Returns:
/** * Creates a clustered instance using the specified options. * <p> * The instance is created asynchronously and the resultHandler is called with the result when it is ready. * @param options the options to use * @return */
public static Single<io.vertx.rxjava.core.Vertx> rxClusteredVertx(io.vertx.core.VertxOptions options) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { clusteredVertx(options, fut); })); }
Gets the current context
Returns:The current context or null if there is no current context
/** * Gets the current context * @return The current context or <code>null</code> if there is no current context */
public static io.vertx.rxjava.core.Context currentContext() { io.vertx.rxjava.core.Context ret = io.vertx.rxjava.core.Context.newInstance((io.vertx.core.Context)io.vertx.core.Vertx.currentContext()); return ret; }
Gets the current context, or creates one if there isn't one
Returns:The current context (created if didn't exist)
/** * Gets the current context, or creates one if there isn't one * @return The current context (created if didn't exist) */
public io.vertx.rxjava.core.Context getOrCreateContext() { io.vertx.rxjava.core.Context ret = io.vertx.rxjava.core.Context.newInstance((io.vertx.core.Context)delegate.getOrCreateContext()); return ret; }
Create a TCP/SSL server using the specified options
Params:
  • options – the options to use
Returns:the server
/** * Create a TCP/SSL server using the specified options * @param options the options to use * @return the server */
public io.vertx.rxjava.core.net.NetServer createNetServer(io.vertx.core.net.NetServerOptions options) { io.vertx.rxjava.core.net.NetServer ret = io.vertx.rxjava.core.net.NetServer.newInstance((io.vertx.core.net.NetServer)delegate.createNetServer(options)); return ret; }
Create a TCP/SSL server using default options
Returns:the server
/** * Create a TCP/SSL server using default options * @return the server */
public io.vertx.rxjava.core.net.NetServer createNetServer() { io.vertx.rxjava.core.net.NetServer ret = io.vertx.rxjava.core.net.NetServer.newInstance((io.vertx.core.net.NetServer)delegate.createNetServer()); return ret; }
Create a TCP/SSL client using the specified options
Params:
  • options – the options to use
Returns:the client
/** * Create a TCP/SSL client using the specified options * @param options the options to use * @return the client */
public io.vertx.rxjava.core.net.NetClient createNetClient(io.vertx.core.net.NetClientOptions options) { io.vertx.rxjava.core.net.NetClient ret = io.vertx.rxjava.core.net.NetClient.newInstance((io.vertx.core.net.NetClient)delegate.createNetClient(options)); return ret; }
Create a TCP/SSL client using default options
Returns:the client
/** * Create a TCP/SSL client using default options * @return the client */
public io.vertx.rxjava.core.net.NetClient createNetClient() { io.vertx.rxjava.core.net.NetClient ret = io.vertx.rxjava.core.net.NetClient.newInstance((io.vertx.core.net.NetClient)delegate.createNetClient()); return ret; }
Create an HTTP/HTTPS server using the specified options
Params:
  • options – the options to use
Returns:the server
/** * Create an HTTP/HTTPS server using the specified options * @param options the options to use * @return the server */
public io.vertx.rxjava.core.http.HttpServer createHttpServer(io.vertx.core.http.HttpServerOptions options) { io.vertx.rxjava.core.http.HttpServer ret = io.vertx.rxjava.core.http.HttpServer.newInstance((io.vertx.core.http.HttpServer)delegate.createHttpServer(options)); return ret; }
Create an HTTP/HTTPS server using default options
Returns:the server
/** * Create an HTTP/HTTPS server using default options * @return the server */
public io.vertx.rxjava.core.http.HttpServer createHttpServer() { io.vertx.rxjava.core.http.HttpServer ret = io.vertx.rxjava.core.http.HttpServer.newInstance((io.vertx.core.http.HttpServer)delegate.createHttpServer()); return ret; }
Create a HTTP/HTTPS client using the specified options
Params:
  • options – the options to use
Returns:the client
/** * Create a HTTP/HTTPS client using the specified options * @param options the options to use * @return the client */
public io.vertx.rxjava.core.http.HttpClient createHttpClient(io.vertx.core.http.HttpClientOptions options) { io.vertx.rxjava.core.http.HttpClient ret = io.vertx.rxjava.core.http.HttpClient.newInstance((io.vertx.core.http.HttpClient)delegate.createHttpClient(options)); return ret; }
Create a HTTP/HTTPS client using default options
Returns:the client
/** * Create a HTTP/HTTPS client using default options * @return the client */
public io.vertx.rxjava.core.http.HttpClient createHttpClient() { io.vertx.rxjava.core.http.HttpClient ret = io.vertx.rxjava.core.http.HttpClient.newInstance((io.vertx.core.http.HttpClient)delegate.createHttpClient()); return ret; }
Create a datagram socket using the specified options
Params:
  • options – the options to use
Returns:the socket
/** * Create a datagram socket using the specified options * @param options the options to use * @return the socket */
public io.vertx.rxjava.core.datagram.DatagramSocket createDatagramSocket(io.vertx.core.datagram.DatagramSocketOptions options) { io.vertx.rxjava.core.datagram.DatagramSocket ret = io.vertx.rxjava.core.datagram.DatagramSocket.newInstance((io.vertx.core.datagram.DatagramSocket)delegate.createDatagramSocket(options)); return ret; }
Create a datagram socket using default options
Returns:the socket
/** * Create a datagram socket using default options * @return the socket */
public io.vertx.rxjava.core.datagram.DatagramSocket createDatagramSocket() { io.vertx.rxjava.core.datagram.DatagramSocket ret = io.vertx.rxjava.core.datagram.DatagramSocket.newInstance((io.vertx.core.datagram.DatagramSocket)delegate.createDatagramSocket()); return ret; }
Get the filesystem object. There is a single instance of FileSystem per Vertx instance.
Returns:the filesystem object
/** * Get the filesystem object. There is a single instance of FileSystem per Vertx instance. * @return the filesystem object */
public io.vertx.rxjava.core.file.FileSystem fileSystem() { if (cached_0 != null) { return cached_0; } io.vertx.rxjava.core.file.FileSystem ret = io.vertx.rxjava.core.file.FileSystem.newInstance((io.vertx.core.file.FileSystem)delegate.fileSystem()); cached_0 = ret; return ret; }
Get the event bus object. There is a single instance of EventBus per Vertx instance.
Returns:the event bus object
/** * Get the event bus object. There is a single instance of EventBus per Vertx instance. * @return the event bus object */
public io.vertx.rxjava.core.eventbus.EventBus eventBus() { if (cached_1 != null) { return cached_1; } io.vertx.rxjava.core.eventbus.EventBus ret = io.vertx.rxjava.core.eventbus.EventBus.newInstance((io.vertx.core.eventbus.EventBus)delegate.eventBus()); cached_1 = ret; return ret; }
Create a DNS client to connect to a DNS server at the specified host and port, with the default query timeout (5 seconds)

Params:
  • port – the port
  • host – the host
Returns:the DNS client
/** * Create a DNS client to connect to a DNS server at the specified host and port, with the default query timeout (5 seconds) * <p/> * @param port the port * @param host the host * @return the DNS client */
public io.vertx.rxjava.core.dns.DnsClient createDnsClient(int port, String host) { io.vertx.rxjava.core.dns.DnsClient ret = io.vertx.rxjava.core.dns.DnsClient.newInstance((io.vertx.core.dns.DnsClient)delegate.createDnsClient(port, host)); return ret; }
Create a DNS client to connect to the DNS server configured by VertxOptions

DNS client takes the first configured resolver address provided by }

Returns:the DNS client
/** * Create a DNS client to connect to the DNS server configured by {@link io.vertx.core.VertxOptions} * <p> * DNS client takes the first configured resolver address provided by } * @return the DNS client */
public io.vertx.rxjava.core.dns.DnsClient createDnsClient() { io.vertx.rxjava.core.dns.DnsClient ret = io.vertx.rxjava.core.dns.DnsClient.newInstance((io.vertx.core.dns.DnsClient)delegate.createDnsClient()); return ret; }
Create a DNS client to connect to a DNS server
Params:
  • options – the client options
Returns:the DNS client
/** * Create a DNS client to connect to a DNS server * @param options the client options * @return the DNS client */
public io.vertx.rxjava.core.dns.DnsClient createDnsClient(io.vertx.core.dns.DnsClientOptions options) { io.vertx.rxjava.core.dns.DnsClient ret = io.vertx.rxjava.core.dns.DnsClient.newInstance((io.vertx.core.dns.DnsClient)delegate.createDnsClient(options)); return ret; }
Get the shared data object. There is a single instance of SharedData per Vertx instance.
Returns:the shared data object
/** * Get the shared data object. There is a single instance of SharedData per Vertx instance. * @return the shared data object */
public io.vertx.rxjava.core.shareddata.SharedData sharedData() { if (cached_2 != null) { return cached_2; } io.vertx.rxjava.core.shareddata.SharedData ret = io.vertx.rxjava.core.shareddata.SharedData.newInstance((io.vertx.core.shareddata.SharedData)delegate.sharedData()); cached_2 = ret; return ret; }
Set a one-shot timer to fire after delay milliseconds, at which point handler will be called with the id of the timer.
Params:
  • delay – the delay in milliseconds, after which the timer will fire
  • handler – the handler that will be called with the timer ID when the timer fires
Returns:the unique ID of the timer
/** * Set a one-shot timer to fire after <code>delay</code> milliseconds, at which point <code>handler</code> will be called with * the id of the timer. * @param delay the delay in milliseconds, after which the timer will fire * @param handler the handler that will be called with the timer ID when the timer fires * @return the unique ID of the timer */
public long setTimer(long delay, Handler<Long> handler) { long ret = delegate.setTimer(delay, handler); return ret; }
Returns a one-shot timer as a read stream. The timer will be fired after delay milliseconds after the has been called.
Params:
  • delay – the delay in milliseconds, after which the timer will fire
Returns:the timer stream
/** * Returns a one-shot timer as a read stream. The timer will be fired after <code>delay</code> milliseconds after * the has been called. * @param delay the delay in milliseconds, after which the timer will fire * @return the timer stream */
public io.vertx.rxjava.core.TimeoutStream timerStream(long delay) { io.vertx.rxjava.core.TimeoutStream ret = io.vertx.rxjava.core.TimeoutStream.newInstance((io.vertx.core.TimeoutStream)delegate.timerStream(delay)); return ret; }
Set a periodic timer to fire every delay milliseconds, at which point handler will be called with the id of the timer.
Params:
  • delay – the delay in milliseconds, after which the timer will fire
  • handler – the handler that will be called with the timer ID when the timer fires
Returns:the unique ID of the timer
/** * Set a periodic timer to fire every <code>delay</code> milliseconds, at which point <code>handler</code> will be called with * the id of the timer. * @param delay the delay in milliseconds, after which the timer will fire * @param handler the handler that will be called with the timer ID when the timer fires * @return the unique ID of the timer */
public long setPeriodic(long delay, Handler<Long> handler) { long ret = delegate.setPeriodic(delay, handler); return ret; }
Returns a periodic timer as a read stream. The timer will be fired every delay milliseconds after the has been called.
Params:
  • delay – the delay in milliseconds, after which the timer will fire
Returns:the periodic stream
/** * Returns a periodic timer as a read stream. The timer will be fired every <code>delay</code> milliseconds after * the has been called. * @param delay the delay in milliseconds, after which the timer will fire * @return the periodic stream */
public io.vertx.rxjava.core.TimeoutStream periodicStream(long delay) { io.vertx.rxjava.core.TimeoutStream ret = io.vertx.rxjava.core.TimeoutStream.newInstance((io.vertx.core.TimeoutStream)delegate.periodicStream(delay)); return ret; }
Cancels the timer with the specified id.
Params:
  • id – The id of the timer to cancel
Returns:true if the timer was successfully cancelled, or false if the timer does not exist.
/** * Cancels the timer with the specified <code>id</code>. * @param id The id of the timer to cancel * @return true if the timer was successfully cancelled, or false if the timer does not exist. */
public boolean cancelTimer(long id) { boolean ret = delegate.cancelTimer(id); return ret; }
Puts the handler on the event queue for the current context so it will be run asynchronously ASAP after all preceeding events have been handled.
Params:
  • action – - a handler representing the action to execute
/** * Puts the handler on the event queue for the current context so it will be run asynchronously ASAP after all * preceeding events have been handled. * @param action - a handler representing the action to execute */
public void runOnContext(Handler<Void> action) { delegate.runOnContext(action); }
Like close but the completionHandler will be called when the close is complete
Params:
  • completionHandler – The handler will be notified when the close is complete.
/** * Like {@link io.vertx.rxjava.core.Vertx#close} but the completionHandler will be called when the close is complete * @param completionHandler The handler will be notified when the close is complete. */
public void close(Handler<AsyncResult<Void>> completionHandler) { delegate.close(completionHandler); }
Like close but the completionHandler will be called when the close is complete
/** * Like {@link io.vertx.rxjava.core.Vertx#close} but the completionHandler will be called when the close is complete */
public void close() { close(ar -> { }); }
Like close but the completionHandler will be called when the close is complete
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#close} but the completionHandler will be called when the close is complete * @return */
public Single<Void> rxClose() { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { close(fut); })); }
Like deployVerticle but the completionHandler will be notified when the deployment is complete.

If the deployment is successful the result will contain a String representing the unique deployment ID of the deployment.

This deployment ID can subsequently be used to undeploy the verticle.

Params:
  • name – The identifier
  • completionHandler – a handler which will be notified when the deployment is complete
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but the completionHandler will be notified when the deployment is complete. * <p> * If the deployment is successful the result will contain a String representing the unique deployment ID of the * deployment. * <p> * This deployment ID can subsequently be used to undeploy the verticle. * @param name The identifier * @param completionHandler a handler which will be notified when the deployment is complete */
public void deployVerticle(String name, Handler<AsyncResult<String>> completionHandler) { delegate.deployVerticle(name, completionHandler); }
Like deployVerticle but the completionHandler will be notified when the deployment is complete.

If the deployment is successful the result will contain a String representing the unique deployment ID of the deployment.

This deployment ID can subsequently be used to undeploy the verticle.

Params:
  • name – The identifier
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but the completionHandler will be notified when the deployment is complete. * <p> * If the deployment is successful the result will contain a String representing the unique deployment ID of the * deployment. * <p> * This deployment ID can subsequently be used to undeploy the verticle. * @param name The identifier */
public void deployVerticle(String name) { deployVerticle(name, ar -> { }); }
Like deployVerticle but the completionHandler will be notified when the deployment is complete.

If the deployment is successful the result will contain a String representing the unique deployment ID of the deployment.

This deployment ID can subsequently be used to undeploy the verticle.

Params:
  • name – The identifier
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but the completionHandler will be notified when the deployment is complete. * <p> * If the deployment is successful the result will contain a String representing the unique deployment ID of the * deployment. * <p> * This deployment ID can subsequently be used to undeploy the verticle. * @param name The identifier * @return */
public Single<String> rxDeployVerticle(String name) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { deployVerticle(name, fut); })); }
Like deployVerticle but DeploymentOptions are provided to configure the deployment.
Params:
  • name – the name
  • options – the deployment options.
  • completionHandler – a handler which will be notified when the deployment is complete
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.DeploymentOptions} are provided to configure the * deployment. * @param name the name * @param options the deployment options. * @param completionHandler a handler which will be notified when the deployment is complete */
public void deployVerticle(String name, io.vertx.core.DeploymentOptions options, Handler<AsyncResult<String>> completionHandler) { delegate.deployVerticle(name, options, completionHandler); }
Like deployVerticle but DeploymentOptions are provided to configure the deployment.
Params:
  • name – the name
  • options – the deployment options.
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.DeploymentOptions} are provided to configure the * deployment. * @param name the name * @param options the deployment options. */
public void deployVerticle(String name, io.vertx.core.DeploymentOptions options) { deployVerticle(name, options, ar -> { }); }
Like deployVerticle but DeploymentOptions are provided to configure the deployment.
Params:
  • name – the name
  • options – the deployment options.
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.DeploymentOptions} are provided to configure the * deployment. * @param name the name * @param options the deployment options. * @return */
public Single<String> rxDeployVerticle(String name, io.vertx.core.DeploymentOptions options) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { deployVerticle(name, options, fut); })); }
Like undeploy(String) but the completionHandler will be notified when the undeployment is complete.
Params:
  • deploymentID – the deployment ID
  • completionHandler – a handler which will be notified when the undeployment is complete
/** * Like {@link io.vertx.rxjava.core.Vertx #undeploy(String)} but the completionHandler will be notified when the undeployment is complete. * @param deploymentID the deployment ID * @param completionHandler a handler which will be notified when the undeployment is complete */
public void undeploy(String deploymentID, Handler<AsyncResult<Void>> completionHandler) { delegate.undeploy(deploymentID, completionHandler); }
Like undeploy(String) but the completionHandler will be notified when the undeployment is complete.
Params:
  • deploymentID – the deployment ID
/** * Like {@link io.vertx.rxjava.core.Vertx #undeploy(String)} but the completionHandler will be notified when the undeployment is complete. * @param deploymentID the deployment ID */
public void undeploy(String deploymentID) { undeploy(deploymentID, ar -> { }); }
Like undeploy(String) but the completionHandler will be notified when the undeployment is complete.
Params:
  • deploymentID – the deployment ID
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx #undeploy(String)} but the completionHandler will be notified when the undeployment is complete. * @param deploymentID the deployment ID * @return */
public Single<Void> rxUndeploy(String deploymentID) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { undeploy(deploymentID, fut); })); }
Return a Set of deployment IDs for the currently deployed deploymentIDs.
Returns:Set of deployment IDs
/** * Return a Set of deployment IDs for the currently deployed deploymentIDs. * @return Set of deployment IDs */
public Set<String> deploymentIDs() { Set<String> ret = delegate.deploymentIDs(); return ret; }
Is this Vert.x instance clustered?
Returns:true if clustered
/** * Is this Vert.x instance clustered? * @return true if clustered */
public boolean isClustered() { boolean ret = delegate.isClustered(); return ret; }
Safely execute some blocking code.

Executes the blocking code in the handler blockingCodeHandler using a thread from the worker pool.

When the code is complete the handler resultHandler will be called with the result on the original context (e.g. on the original event loop of the caller).

A Future instance is passed into blockingCodeHandler. When the blocking code successfully completes, the handler should call the Promise.complete or Promise.complete method, or the Promise.fail method if it failed.

In the blockingCodeHandler the current context remains the original context and therefore any task scheduled in the blockingCodeHandler will be executed on the this context and not on the worker thread.

The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded.

When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the blocked thread checker.

Long blocking operations should use a dedicated thread managed by the application, which can interact with verticles using the event-bus or Context.runOnContext

Params:
  • blockingCodeHandler – handler representing the blocking code to run
  • ordered – if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees
  • resultHandler – handler that will be called when the blocking code is complete
/** * Safely execute some blocking code. * <p> * Executes the blocking code in the handler <code>blockingCodeHandler</code> using a thread from the worker pool. * <p> * When the code is complete the handler <code>resultHandler</code> will be called with the result on the original context * (e.g. on the original event loop of the caller). * <p> * A <code>Future</code> instance is passed into <code>blockingCodeHandler</code>. When the blocking code successfully completes, * the handler should call the {@link io.vertx.rxjava.core.Promise#complete} or {@link io.vertx.rxjava.core.Promise#complete} method, or the {@link io.vertx.rxjava.core.Promise#fail} * method if it failed. * <p> * In the <code>blockingCodeHandler</code> the current context remains the original context and therefore any task * scheduled in the <code>blockingCodeHandler</code> will be executed on the this context and not on the worker thread. * <p> * The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations * or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded. * <p> * When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the * blocked thread checker. * <p> * Long blocking operations should use a dedicated thread managed by the application, which can interact with * verticles using the event-bus or {@link io.vertx.rxjava.core.Context#runOnContext} * @param blockingCodeHandler handler representing the blocking code to run * @param ordered if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees * @param resultHandler handler that will be called when the blocking code is complete */
public <T> void executeBlocking(Handler<io.vertx.rxjava.core.Promise<T>> blockingCodeHandler, boolean ordered, Handler<AsyncResult<T>> resultHandler) { delegate.executeBlocking(new Handler<io.vertx.core.Promise<T>>() { public void handle(io.vertx.core.Promise<T> event) { blockingCodeHandler.handle(io.vertx.rxjava.core.Promise.newInstance((io.vertx.core.Promise)event, TypeArg.unknown())); } }, ordered, resultHandler); }
Safely execute some blocking code.

Executes the blocking code in the handler blockingCodeHandler using a thread from the worker pool.

When the code is complete the handler resultHandler will be called with the result on the original context (e.g. on the original event loop of the caller).

A Future instance is passed into blockingCodeHandler. When the blocking code successfully completes, the handler should call the Promise.complete or Promise.complete method, or the Promise.fail method if it failed.

In the blockingCodeHandler the current context remains the original context and therefore any task scheduled in the blockingCodeHandler will be executed on the this context and not on the worker thread.

The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded.

When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the blocked thread checker.

Long blocking operations should use a dedicated thread managed by the application, which can interact with verticles using the event-bus or Context.runOnContext

Params:
  • blockingCodeHandler – handler representing the blocking code to run
  • ordered – if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees
/** * Safely execute some blocking code. * <p> * Executes the blocking code in the handler <code>blockingCodeHandler</code> using a thread from the worker pool. * <p> * When the code is complete the handler <code>resultHandler</code> will be called with the result on the original context * (e.g. on the original event loop of the caller). * <p> * A <code>Future</code> instance is passed into <code>blockingCodeHandler</code>. When the blocking code successfully completes, * the handler should call the {@link io.vertx.rxjava.core.Promise#complete} or {@link io.vertx.rxjava.core.Promise#complete} method, or the {@link io.vertx.rxjava.core.Promise#fail} * method if it failed. * <p> * In the <code>blockingCodeHandler</code> the current context remains the original context and therefore any task * scheduled in the <code>blockingCodeHandler</code> will be executed on the this context and not on the worker thread. * <p> * The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations * or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded. * <p> * When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the * blocked thread checker. * <p> * Long blocking operations should use a dedicated thread managed by the application, which can interact with * verticles using the event-bus or {@link io.vertx.rxjava.core.Context#runOnContext} * @param blockingCodeHandler handler representing the blocking code to run * @param ordered if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees */
public <T> void executeBlocking(Handler<io.vertx.rxjava.core.Promise<T>> blockingCodeHandler, boolean ordered) { executeBlocking(blockingCodeHandler, ordered, ar -> { }); }
Safely execute some blocking code.

Executes the blocking code in the handler blockingCodeHandler using a thread from the worker pool.

When the code is complete the handler resultHandler will be called with the result on the original context (e.g. on the original event loop of the caller).

A Future instance is passed into blockingCodeHandler. When the blocking code successfully completes, the handler should call the Promise.complete or Promise.complete method, or the Promise.fail method if it failed.

In the blockingCodeHandler the current context remains the original context and therefore any task scheduled in the blockingCodeHandler will be executed on the this context and not on the worker thread.

The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded.

When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the blocked thread checker.

Long blocking operations should use a dedicated thread managed by the application, which can interact with verticles using the event-bus or Context.runOnContext

Params:
  • blockingCodeHandler – handler representing the blocking code to run
  • ordered – if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees
Returns:
/** * Safely execute some blocking code. * <p> * Executes the blocking code in the handler <code>blockingCodeHandler</code> using a thread from the worker pool. * <p> * When the code is complete the handler <code>resultHandler</code> will be called with the result on the original context * (e.g. on the original event loop of the caller). * <p> * A <code>Future</code> instance is passed into <code>blockingCodeHandler</code>. When the blocking code successfully completes, * the handler should call the {@link io.vertx.rxjava.core.Promise#complete} or {@link io.vertx.rxjava.core.Promise#complete} method, or the {@link io.vertx.rxjava.core.Promise#fail} * method if it failed. * <p> * In the <code>blockingCodeHandler</code> the current context remains the original context and therefore any task * scheduled in the <code>blockingCodeHandler</code> will be executed on the this context and not on the worker thread. * <p> * The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations * or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded. * <p> * When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the * blocked thread checker. * <p> * Long blocking operations should use a dedicated thread managed by the application, which can interact with * verticles using the event-bus or {@link io.vertx.rxjava.core.Context#runOnContext} * @param blockingCodeHandler handler representing the blocking code to run * @param ordered if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees * @return */
public <T> Single<T> rxExecuteBlocking(Handler<io.vertx.rxjava.core.Promise<T>> blockingCodeHandler, boolean ordered) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { executeBlocking(blockingCodeHandler, ordered, fut); })); }
Like executeBlocking called with ordered = true.
Params:
  • blockingCodeHandler –
  • resultHandler –
/** * Like {@link io.vertx.rxjava.core.Vertx#executeBlocking} called with ordered = true. * @param blockingCodeHandler * @param resultHandler */
public <T> void executeBlocking(Handler<io.vertx.rxjava.core.Promise<T>> blockingCodeHandler, Handler<AsyncResult<T>> resultHandler) { delegate.executeBlocking(new Handler<io.vertx.core.Promise<T>>() { public void handle(io.vertx.core.Promise<T> event) { blockingCodeHandler.handle(io.vertx.rxjava.core.Promise.newInstance((io.vertx.core.Promise)event, TypeArg.unknown())); } }, resultHandler); }
Like executeBlocking called with ordered = true.
Params:
  • blockingCodeHandler –
/** * Like {@link io.vertx.rxjava.core.Vertx#executeBlocking} called with ordered = true. * @param blockingCodeHandler */
public <T> void executeBlocking(Handler<io.vertx.rxjava.core.Promise<T>> blockingCodeHandler) { executeBlocking(blockingCodeHandler, ar -> { }); }
Like executeBlocking called with ordered = true.
Params:
  • blockingCodeHandler –
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#executeBlocking} called with ordered = true. * @param blockingCodeHandler * @return */
public <T> Single<T> rxExecuteBlocking(Handler<io.vertx.rxjava.core.Promise<T>> blockingCodeHandler) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { executeBlocking(blockingCodeHandler, fut); })); }
Like createSharedWorkerExecutor but with the VertxOptions poolSize.
Params:
  • name –
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#createSharedWorkerExecutor} but with the {@link io.vertx.core.VertxOptions} <code>poolSize</code>. * @param name * @return */
public io.vertx.rxjava.core.WorkerExecutor createSharedWorkerExecutor(String name) { io.vertx.rxjava.core.WorkerExecutor ret = io.vertx.rxjava.core.WorkerExecutor.newInstance((io.vertx.core.WorkerExecutor)delegate.createSharedWorkerExecutor(name)); return ret; }
Like createSharedWorkerExecutor but with the VertxOptions maxExecuteTime.
Params:
  • name –
  • poolSize –
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#createSharedWorkerExecutor} but with the {@link io.vertx.core.VertxOptions} <code>maxExecuteTime</code>. * @param name * @param poolSize * @return */
public io.vertx.rxjava.core.WorkerExecutor createSharedWorkerExecutor(String name, int poolSize) { io.vertx.rxjava.core.WorkerExecutor ret = io.vertx.rxjava.core.WorkerExecutor.newInstance((io.vertx.core.WorkerExecutor)delegate.createSharedWorkerExecutor(name, poolSize)); return ret; }
Like createSharedWorkerExecutor but with the .
Params:
  • name –
  • poolSize –
  • maxExecuteTime –
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#createSharedWorkerExecutor} but with the . * @param name * @param poolSize * @param maxExecuteTime * @return */
public io.vertx.rxjava.core.WorkerExecutor createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime) { io.vertx.rxjava.core.WorkerExecutor ret = io.vertx.rxjava.core.WorkerExecutor.newInstance((io.vertx.core.WorkerExecutor)delegate.createSharedWorkerExecutor(name, poolSize, maxExecuteTime)); return ret; }
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.

Params:
  • name – the name of the worker executor
  • poolSize – the size of the pool
  • maxExecuteTime – the value of max worker execute time
  • maxExecuteTimeUnit – the value of unit of max worker execute time
Returns:the named worker executor
/** * Create a named worker executor, the executor should be closed when it's not needed anymore to release * resources.<p/> * * This method can be called mutiple times with the same <code>name</code>. 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.<p> * * The worker pool is released when all the {@link io.vertx.rxjava.core.WorkerExecutor} sharing the same name are closed. * @param name the name of the worker executor * @param poolSize the size of the pool * @param maxExecuteTime the value of max worker execute time * @param maxExecuteTimeUnit the value of unit of max worker execute time * @return the named worker executor */
public io.vertx.rxjava.core.WorkerExecutor createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime, java.util.concurrent.TimeUnit maxExecuteTimeUnit) { io.vertx.rxjava.core.WorkerExecutor ret = io.vertx.rxjava.core.WorkerExecutor.newInstance((io.vertx.core.WorkerExecutor)delegate.createSharedWorkerExecutor(name, poolSize, maxExecuteTime, maxExecuteTimeUnit)); return ret; }
Returns:whether the native transport is used
/** * @return whether the native transport is used */
public boolean isNativeTransportEnabled() { if (cached_3 != null) { return cached_3; } boolean ret = delegate.isNativeTransportEnabled(); cached_3 = ret; return ret; }
Set a default exception handler for Context, set on at creation.
Params:
  • handler – the exception handler
Returns:a reference to this, so the API can be used fluently
/** * Set a default exception handler for {@link io.vertx.rxjava.core.Context}, set on at creation. * @param handler the exception handler * @return a reference to this, so the API can be used fluently */
public io.vertx.rxjava.core.Vertx exceptionHandler(Handler<java.lang.Throwable> handler) { delegate.exceptionHandler(handler); return this; }
Like deployVerticle but the completionHandler will be notified when the deployment is complete.

If the deployment is successful the result will contain a string representing the unique deployment ID of the deployment.

This deployment ID can subsequently be used to undeploy the verticle.

Params:
  • verticle – the verticle instance to deploy
  • completionHandler – a handler which will be notified when the deployment is complete
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but the completionHandler will be notified when the deployment is complete. * <p> * If the deployment is successful the result will contain a string representing the unique deployment ID of the * deployment. * <p> * This deployment ID can subsequently be used to undeploy the verticle. * @param verticle the verticle instance to deploy * @param completionHandler a handler which will be notified when the deployment is complete */
public void deployVerticle(io.vertx.core.Verticle verticle, Handler<AsyncResult<String>> completionHandler) { delegate.deployVerticle(verticle, completionHandler); }
Like deployVerticle but the completionHandler will be notified when the deployment is complete.

If the deployment is successful the result will contain a string representing the unique deployment ID of the deployment.

This deployment ID can subsequently be used to undeploy the verticle.

Params:
  • verticle – the verticle instance to deploy
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but the completionHandler will be notified when the deployment is complete. * <p> * If the deployment is successful the result will contain a string representing the unique deployment ID of the * deployment. * <p> * This deployment ID can subsequently be used to undeploy the verticle. * @param verticle the verticle instance to deploy */
public void deployVerticle(io.vertx.core.Verticle verticle) { deployVerticle(verticle, ar -> { }); }
Like deployVerticle but the completionHandler will be notified when the deployment is complete.

If the deployment is successful the result will contain a string representing the unique deployment ID of the deployment.

This deployment ID can subsequently be used to undeploy the verticle.

Params:
  • verticle – the verticle instance to deploy
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but the completionHandler will be notified when the deployment is complete. * <p> * If the deployment is successful the result will contain a string representing the unique deployment ID of the * deployment. * <p> * This deployment ID can subsequently be used to undeploy the verticle. * @param verticle the verticle instance to deploy * @return */
public Single<String> rxDeployVerticle(io.vertx.core.Verticle verticle) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { deployVerticle(verticle, fut); })); }
Like deployVerticle but DeploymentOptions are provided to configure the deployment.
Params:
  • verticle – the verticle instance to deploy
  • options – the deployment options.
  • completionHandler – a handler which will be notified when the deployment is complete
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.DeploymentOptions} are provided to configure the * deployment. * @param verticle the verticle instance to deploy * @param options the deployment options. * @param completionHandler a handler which will be notified when the deployment is complete */
public void deployVerticle(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options, Handler<AsyncResult<String>> completionHandler) { delegate.deployVerticle(verticle, options, completionHandler); }
Like deployVerticle but DeploymentOptions are provided to configure the deployment.
Params:
  • verticle – the verticle instance to deploy
  • options – the deployment options.
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.DeploymentOptions} are provided to configure the * deployment. * @param verticle the verticle instance to deploy * @param options the deployment options. */
public void deployVerticle(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) { deployVerticle(verticle, options, ar -> { }); }
Like deployVerticle but DeploymentOptions are provided to configure the deployment.
Params:
  • verticle – the verticle instance to deploy
  • options – the deployment options.
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.DeploymentOptions} are provided to configure the * deployment. * @param verticle the verticle instance to deploy * @param options the deployment options. * @return */
public Single<String> rxDeployVerticle(io.vertx.core.Verticle verticle, io.vertx.core.DeploymentOptions options) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { deployVerticle(verticle, options, fut); })); }
Like deployVerticle but Verticle instance is created by invoking the verticleSupplier.

The supplier will be invoked as many times as DeploymentOptions. It must not return the same instance twice.

Note that the supplier will be invoked on the caller thread.

Params:
  • verticleSupplier –
  • options –
  • completionHandler –
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.Verticle} instance is created by * invoking the <code>verticleSupplier</code>. * <p> * The supplier will be invoked as many times as {@link io.vertx.core.DeploymentOptions}. * It must not return the same instance twice. * <p> * Note that the supplier will be invoked on the caller thread. * @param verticleSupplier * @param options * @param completionHandler */
public void deployVerticle(java.util.function.Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options, Handler<AsyncResult<String>> completionHandler) { delegate.deployVerticle(verticleSupplier, options, completionHandler); }
Like deployVerticle but Verticle instance is created by invoking the verticleSupplier.

The supplier will be invoked as many times as DeploymentOptions. It must not return the same instance twice.

Note that the supplier will be invoked on the caller thread.

Params:
  • verticleSupplier –
  • options –
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.Verticle} instance is created by * invoking the <code>verticleSupplier</code>. * <p> * The supplier will be invoked as many times as {@link io.vertx.core.DeploymentOptions}. * It must not return the same instance twice. * <p> * Note that the supplier will be invoked on the caller thread. * @param verticleSupplier * @param options */
public void deployVerticle(java.util.function.Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) { deployVerticle(verticleSupplier, options, ar -> { }); }
Like deployVerticle but Verticle instance is created by invoking the verticleSupplier.

The supplier will be invoked as many times as DeploymentOptions. It must not return the same instance twice.

Note that the supplier will be invoked on the caller thread.

Params:
  • verticleSupplier –
  • options –
Returns:
/** * Like {@link io.vertx.rxjava.core.Vertx#deployVerticle} but {@link io.vertx.core.Verticle} instance is created by * invoking the <code>verticleSupplier</code>. * <p> * The supplier will be invoked as many times as {@link io.vertx.core.DeploymentOptions}. * It must not return the same instance twice. * <p> * Note that the supplier will be invoked on the caller thread. * @param verticleSupplier * @param options * @return */
public Single<String> rxDeployVerticle(java.util.function.Supplier<io.vertx.core.Verticle> verticleSupplier, io.vertx.core.DeploymentOptions options) { return Single.create(new SingleOnSubscribeAdapter<>(fut -> { deployVerticle(verticleSupplier, options, fut); })); }
Register a VerticleFactory that can be used for deploying Verticles based on an identifier.
Params:
  • factory – the factory to register
/** * Register a <code>VerticleFactory</code> that can be used for deploying Verticles based on an identifier. * @param factory the factory to register */
public void registerVerticleFactory(io.vertx.core.spi.VerticleFactory factory) { delegate.registerVerticleFactory(factory); }
Unregister a VerticleFactory
Params:
  • factory – the factory to unregister
/** * Unregister a <code>VerticleFactory</code> * @param factory the factory to unregister */
public void unregisterVerticleFactory(io.vertx.core.spi.VerticleFactory factory) { delegate.unregisterVerticleFactory(factory); }
Return the Set of currently registered verticle factories.
Returns:the set of verticle factories
/** * Return the Set of currently registered verticle factories. * @return the set of verticle factories */
public Set<io.vertx.core.spi.VerticleFactory> verticleFactories() { Set<io.vertx.core.spi.VerticleFactory> ret = delegate.verticleFactories(); return ret; }
Return the Netty EventLoopGroup used by Vert.x
Returns:the EventLoopGroup
/** * Return the Netty EventLoopGroup used by Vert.x * @return the EventLoopGroup */
public io.netty.channel.EventLoopGroup nettyEventLoopGroup() { io.netty.channel.EventLoopGroup ret = delegate.nettyEventLoopGroup(); return ret; } private io.vertx.rxjava.core.file.FileSystem cached_0; private io.vertx.rxjava.core.eventbus.EventBus cached_1; private io.vertx.rxjava.core.shareddata.SharedData cached_2; private java.lang.Boolean cached_3; public static Vertx newInstance(io.vertx.core.Vertx arg) { return arg != null ? new Vertx(arg) : null; } }