public final class DataSource extends Object implements AgroalDataSource, AgroalDataSourceConfiguration.MetricsEnabledListener
| Constructor and Description |
|---|
DataSource(AgroalDataSourceConfiguration dataSourceConfiguration,
AgroalDataSourceListener... listeners) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(AgroalDataSourceListener listener)
Deprecated.
|
void |
close() |
AgroalDataSourceConfiguration |
getConfiguration() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
AgroalDataSourceMetrics |
getMetrics() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> target) |
Collection<AgroalDataSourceListener> |
listenerList() |
MetricsRepository |
metricsRepository() |
void |
onMetricsEnabled(boolean metricsEnabled) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
<T> T |
unwrap(Class<T> target) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfrom, frompublic DataSource(AgroalDataSourceConfiguration dataSourceConfiguration, AgroalDataSourceListener... listeners)
public Collection<AgroalDataSourceListener> listenerList()
public MetricsRepository metricsRepository()
public void onMetricsEnabled(boolean metricsEnabled)
onMetricsEnabled in interface AgroalDataSourceConfiguration.MetricsEnabledListenerpublic AgroalDataSourceConfiguration getConfiguration()
getConfiguration in interface AgroalDataSourcepublic AgroalDataSourceMetrics getMetrics()
getMetrics in interface AgroalDataSource@Deprecated public void addListener(AgroalDataSourceListener listener)
addListener in interface AgroalDataSourcepublic void close()
close in interface AgroalDataSourceclose in interface AutoCloseablepublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic <T> T unwrap(Class<T> target) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> target) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2017 JBoss by Red Hat. All rights reserved.