Skip to content

Commit

Permalink
AbstractVerticle -> VerticleBase in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Oct 22, 2024
1 parent a59cd24 commit a34d019
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
15 changes: 7 additions & 8 deletions vertx-db2-client/src/main/java/examples/SqlClientExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -405,6 +403,7 @@ public void start() {
.connectingTo(database)
.using(vertx)
.build();
return super.start();
}
}, new DeploymentOptions().setInstances(4));
}
Expand Down
15 changes: 7 additions & 8 deletions vertx-mssql-client/src/main/java/examples/SqlClientExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -413,6 +411,7 @@ public void start() {
.setName("my-pool"))
.using(vertx)
.build();
return super.start();
}
}, new DeploymentOptions().setInstances(4));
}
Expand Down
15 changes: 7 additions & 8 deletions vertx-mysql-client/src/main/java/examples/SqlClientExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -384,6 +382,7 @@ public void start() {
.setName("my-pool"))
.using(vertx)
.build();
return super.start();
}
}, new DeploymentOptions().setInstances(4));
}
Expand Down
15 changes: 7 additions & 8 deletions vertx-pg-client/src/main/java/examples/SqlClientExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -405,6 +403,7 @@ public void start() {
.connectingTo(database)
.using(vertx)
.build();
return super.start();
}
}, new DeploymentOptions().setInstances(4));
}
Expand Down

0 comments on commit a34d019

Please sign in to comment.