|
16 | 16 | package io.vertx.db2client; |
17 | 17 |
|
18 | 18 | import io.vertx.codegen.annotations.Fluent; |
| 19 | +import io.vertx.codegen.annotations.GenIgnore; |
19 | 20 | import io.vertx.codegen.annotations.VertxGen; |
20 | 21 | import io.vertx.core.Context; |
21 | 22 | import io.vertx.core.Future; |
|
31 | 32 | import java.util.Collections; |
32 | 33 | import java.util.List; |
33 | 34 | import java.util.function.Function; |
| 35 | +import java.util.function.Supplier; |
34 | 36 |
|
35 | 37 | import static io.vertx.db2client.DB2ConnectOptions.fromUri; |
36 | 38 |
|
@@ -109,6 +111,28 @@ static DB2Pool pool(Vertx vertx, List<DB2ConnectOptions> databases, PoolOptions |
109 | 111 | return (DB2Pool) DB2Driver.INSTANCE.createPool(vertx, databases, options); |
110 | 112 | } |
111 | 113 |
|
| 114 | + /** |
| 115 | + * Create a connection pool to the DB2 {@code databases}. The supplier is called |
| 116 | + * to provide the options when a new connection is created by the pool. |
| 117 | + * |
| 118 | + * @param databases the databases supplier |
| 119 | + * @param poolOptions the options for creating the pool |
| 120 | + * @return the connection pool |
| 121 | + */ |
| 122 | + @GenIgnore |
| 123 | + static DB2Pool pool(Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions) { |
| 124 | + return pool(null, databases, poolOptions); |
| 125 | + } |
| 126 | + |
| 127 | + |
| 128 | + /** |
| 129 | + * Like {@link #pool(Supplier, PoolOptions)} with a specific {@link Vertx} instance. |
| 130 | + */ |
| 131 | + @GenIgnore |
| 132 | + static DB2Pool pool(Vertx vertx, Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions) { |
| 133 | + return (DB2Pool) DB2Driver.INSTANCE.createPool(vertx, databases, poolOptions); |
| 134 | + } |
| 135 | + |
112 | 136 | /** |
113 | 137 | * Like {@link #client(String, PoolOptions)} with default options. |
114 | 138 | */ |
|
0 commit comments