public class DataSource extends Object implements AgroalDataSource, AgroalDataSourceConfiguration.MetricsEnabledListener
| Constructor and Description |
|---|
DataSource(AgroalDataSourceConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(AgroalDataSourceListener listener) |
void |
close() |
AgroalDataSourceConfiguration |
getConfiguration() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
AgroalDataSourceMetrics |
getMetrics() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> target) |
List<AgroalDataSourceListener> |
listenerList() |
DataSourceMetricsRepository |
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 configuration)
public List<AgroalDataSourceListener> listenerList()
public DataSourceMetricsRepository metricsRepository()
public void onMetricsEnabled(boolean metricsEnabled)
onMetricsEnabled in interface AgroalDataSourceConfiguration.MetricsEnabledListenerpublic AgroalDataSourceConfiguration getConfiguration()
getConfiguration in interface AgroalDataSourcepublic AgroalDataSourceMetrics getMetrics()
getMetrics in interface AgroalDataSourcepublic 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.