T - The type current class or subclass, which is used for method chaining
Implementation Note:
The generic type T is used for method chaining. A sub class should declare
the Class as follows:
MyDataSourceConfig extends ManagedDataSourceConfig<MyDataSourceConfig>
@DefunctConfig(value={"db.username","db.password"}) public class ManagedDataSourceConfig<T extends ManagedDataSourceConfig<T>> extends Object
ManagedDataSource.
The configuration options can be chained as follows:
ManagedDataSourceConfig config = new ManagedDataSourceConfig()
.setMaxConnections(20)
.setMaxConnectionWait(new Duration(20, TimeUnit.MILLISECONDS));
| Constructor and Description |
|---|
ManagedDataSourceConfig() |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxConnections()
Gets the maximum number of concurrent connections allowed by the data
source.
|
io.airlift.units.Duration |
getMaxConnectionWait()
Gets the maximum time a client is allowed to wait before a connection.
|
T |
setMaxConnections(int maxConnections)
Sets the maximum number of concurrent connections allowed by the data
source.
|
T |
setMaxConnectionWait(io.airlift.units.Duration maxConnectionWait)
Sets the maximum time a client is allowed to wait before a connection.
|
public int getMaxConnections()
@Config(value="db.connections.max") public T setMaxConnections(int maxConnections)
public io.airlift.units.Duration getMaxConnectionWait()
SqlTimeoutException is thrown.@Config(value="db.connections.wait") public T setMaxConnectionWait(io.airlift.units.Duration maxConnectionWait)
SqlTimeoutException is thrown.Copyright © 2010–2019 Airlift. All rights reserved.