From a34d0191915a99651836b74b3be66f1f5acc8c89 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 22 Oct 2024 13:44:17 +0200 Subject: [PATCH] AbstractVerticle -> VerticleBase in examples --- .../src/main/java/examples/SqlClientExamples.java | 15 +++++++-------- .../src/main/java/examples/SqlClientExamples.java | 15 +++++++-------- .../src/main/java/examples/SqlClientExamples.java | 15 +++++++-------- .../src/main/java/examples/SqlClientExamples.java | 15 +++++++-------- 4 files changed, 28 insertions(+), 32 deletions(-) diff --git a/vertx-db2-client/src/main/java/examples/SqlClientExamples.java b/vertx-db2-client/src/main/java/examples/SqlClientExamples.java index 3dc28bef3..0269d62da 100644 --- a/vertx-db2-client/src/main/java/examples/SqlClientExamples.java +++ b/vertx-db2-client/src/main/java/examples/SqlClientExamples.java @@ -15,10 +15,7 @@ */ package examples; -import io.vertx.core.AbstractVerticle; -import io.vertx.core.DeploymentOptions; -import io.vertx.core.Future; -import io.vertx.core.Vertx; +import io.vertx.core.*; import io.vertx.core.tracing.TracingPolicy; import io.vertx.db2client.DB2Builder; import io.vertx.db2client.DB2ConnectOptions; @@ -381,19 +378,20 @@ public void poolSharing1(Vertx vertx, DB2ConnectOptions database, int maxSize) { .connectingTo(database) .using(vertx) .build(); - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { @Override - public void start() throws Exception { + public Future start() throws Exception { // Use the pool + return super.start(); } }, new DeploymentOptions().setInstances(4)); } public void poolSharing2(Vertx vertx, DB2ConnectOptions database, int maxSize) { - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { Pool pool; @Override - public void start() { + public Future start() throws Exception { // Get or create a shared pool // this actually creates a lease to the pool // when the verticle is undeployed, the lease will be released automaticaly @@ -405,6 +403,7 @@ public void start() { .connectingTo(database) .using(vertx) .build(); + return super.start(); } }, new DeploymentOptions().setInstances(4)); } diff --git a/vertx-mssql-client/src/main/java/examples/SqlClientExamples.java b/vertx-mssql-client/src/main/java/examples/SqlClientExamples.java index 615488c67..edeb5c32f 100644 --- a/vertx-mssql-client/src/main/java/examples/SqlClientExamples.java +++ b/vertx-mssql-client/src/main/java/examples/SqlClientExamples.java @@ -16,10 +16,7 @@ */ package examples; -import io.vertx.core.AbstractVerticle; -import io.vertx.core.DeploymentOptions; -import io.vertx.core.Future; -import io.vertx.core.Vertx; +import io.vertx.core.*; import io.vertx.core.tracing.TracingPolicy; import io.vertx.docgen.Source; import io.vertx.mssqlclient.MSSQLBuilder; @@ -390,19 +387,20 @@ public void poolSharing1(Vertx vertx, MSSQLConnectOptions database, int maxSize) .connectingTo(database) .using(vertx) .build(); - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { @Override - public void start() throws Exception { + public Future start() throws Exception { // Use the pool + return super.start(); } }, new DeploymentOptions().setInstances(4)); } public void poolSharing2(Vertx vertx, MSSQLConnectOptions database, int maxSize) { - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { Pool pool; @Override - public void start() { + public Future start() throws Exception { // Get or create a shared pool // this actually creates a lease to the pool // when the verticle is undeployed, the lease will be released automaticaly @@ -413,6 +411,7 @@ public void start() { .setName("my-pool")) .using(vertx) .build(); + return super.start(); } }, new DeploymentOptions().setInstances(4)); } diff --git a/vertx-mysql-client/src/main/java/examples/SqlClientExamples.java b/vertx-mysql-client/src/main/java/examples/SqlClientExamples.java index ba97b8155..d004379ba 100644 --- a/vertx-mysql-client/src/main/java/examples/SqlClientExamples.java +++ b/vertx-mysql-client/src/main/java/examples/SqlClientExamples.java @@ -16,10 +16,7 @@ */ package examples; -import io.vertx.core.AbstractVerticle; -import io.vertx.core.DeploymentOptions; -import io.vertx.core.Future; -import io.vertx.core.Vertx; +import io.vertx.core.*; import io.vertx.core.tracing.TracingPolicy; import io.vertx.docgen.Source; import io.vertx.mysqlclient.MySQLBuilder; @@ -361,19 +358,20 @@ public void poolSharing1(Vertx vertx, MySQLConnectOptions database, int maxSize) .connectingTo(database) .using(vertx) .build(); - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { @Override - public void start() throws Exception { + public Future start() throws Exception { // Use the pool + return super.start(); } }, new DeploymentOptions().setInstances(4)); } public void poolSharing2(Vertx vertx, MySQLConnectOptions database, int maxSize) { - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { Pool pool; @Override - public void start() { + public Future start() throws Exception { // Get or create a shared pool // this actually creates a lease to the pool // when the verticle is undeployed, the lease will be released automaticaly @@ -384,6 +382,7 @@ public void start() { .setName("my-pool")) .using(vertx) .build(); + return super.start(); } }, new DeploymentOptions().setInstances(4)); } diff --git a/vertx-pg-client/src/main/java/examples/SqlClientExamples.java b/vertx-pg-client/src/main/java/examples/SqlClientExamples.java index 605181200..9a1e8159c 100644 --- a/vertx-pg-client/src/main/java/examples/SqlClientExamples.java +++ b/vertx-pg-client/src/main/java/examples/SqlClientExamples.java @@ -16,10 +16,7 @@ */ package examples; -import io.vertx.core.AbstractVerticle; -import io.vertx.core.DeploymentOptions; -import io.vertx.core.Future; -import io.vertx.core.Vertx; +import io.vertx.core.*; import io.vertx.core.tracing.TracingPolicy; import io.vertx.docgen.Source; import io.vertx.pgclient.PgBuilder; @@ -381,19 +378,20 @@ public void poolConfig02(ClientBuilder builder, String sql) { public void poolSharing1(Vertx vertx, PgConnectOptions database, int maxSize) { Pool pool = Pool.pool(database, new PoolOptions().setMaxSize(maxSize)); - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { @Override - public void start() throws Exception { + public Future start() throws Exception { // Use the pool + return super.start(); } }, new DeploymentOptions().setInstances(4)); } public void poolSharing2(Vertx vertx, PgConnectOptions database, int maxSize) { - vertx.deployVerticle(() -> new AbstractVerticle() { + vertx.deployVerticle(() -> new VerticleBase() { Pool pool; @Override - public void start() { + public Future start() throws Exception { // Get or create a shared pool // this actually creates a lease to the pool // when the verticle is undeployed, the lease will be released automaticaly @@ -405,6 +403,7 @@ public void start() { .connectingTo(database) .using(vertx) .build(); + return super.start(); } }, new DeploymentOptions().setInstances(4)); }