@Factory public class DatasourceFactory extends Object implements AutoCloseable
Constructor and Description |
---|
DatasourceFactory(io.micronaut.jdbc.DataSourceResolver dataSourceResolver)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
DataSource |
dataSource(DatasourceConfiguration datasourceConfiguration) |
TomcatDataSourcePoolMetadata |
tomcatPoolDataSourceMetadataProvider(DataSource dataSource)
Method to create a metadata object that allows pool value lookup for each datasource object.
|
public DatasourceFactory(@Nullable io.micronaut.jdbc.DataSourceResolver dataSourceResolver)
dataSourceResolver
- The data source resolver@Context @EachBean(value=DatasourceConfiguration.class) public DataSource dataSource(DatasourceConfiguration datasourceConfiguration)
datasourceConfiguration
- A DatasourceConfiguration
DataSource
@EachBean(value=javax.sql.DataSource.class) @Requires(beans=DatasourceConfiguration.class) public TomcatDataSourcePoolMetadata tomcatPoolDataSourceMetadataProvider(DataSource dataSource)
dataSource
- The datasourceTomcatDataSourcePoolMetadata
@PreDestroy public void close()
close
in interface AutoCloseable