Package io.dropwizard.db
Class ManagedPooledDataSource
java.lang.Object
com.zaxxer.hikari.HikariConfig
com.zaxxer.hikari.HikariDataSource
io.dropwizard.db.ManagedPooledDataSource
- All Implemented Interfaces:
com.zaxxer.hikari.HikariConfigMXBean,io.dropwizard.db.ManagedDataSource,io.dropwizard.lifecycle.Managed,java.io.Closeable,java.lang.AutoCloseable,java.sql.Wrapper,javax.sql.CommonDataSource,javax.sql.DataSource
public class ManagedPooledDataSource
extends com.zaxxer.hikari.HikariDataSource
implements io.dropwizard.db.ManagedDataSource
-
Constructor Summary
Constructors Constructor Description ManagedPooledDataSource(com.zaxxer.hikari.HikariConfig config)ManagedPooledDataSource(com.zaxxer.hikari.HikariConfig config, com.codahale.metrics.MetricRegistry metricRegistry)Create a new data source with the given connection pool configuration. -
Method Summary
Modifier and Type Method Description java.util.logging.LoggergetParentLogger()voidstart()voidstop()Methods inherited from class com.zaxxer.hikari.HikariDataSource
close, evictConnection, getConnection, getConnection, getHikariConfigMXBean, getHikariPoolMXBean, getLoginTimeout, getLogWriter, isClosed, isRunning, isWrapperFor, setHealthCheckRegistry, setLoginTimeout, setLogWriter, setMetricRegistry, setMetricsTrackerFactory, toString, unwrapMethods inherited from class com.zaxxer.hikari.HikariConfig
addDataSourceProperty, addHealthCheckProperty, copyStateTo, getCatalog, getConnectionInitSql, getConnectionTestQuery, getConnectionTimeout, getDataSource, getDataSourceClassName, getDataSourceJNDI, getDataSourceProperties, getDriverClassName, getExceptionOverrideClassName, getHealthCheckProperties, getHealthCheckRegistry, getIdleTimeout, getInitializationFailTimeout, getJdbcUrl, getKeepaliveTime, getLeakDetectionThreshold, getMaximumPoolSize, getMaxLifetime, getMetricRegistry, getMetricsTrackerFactory, getMinimumIdle, getPassword, getPoolName, getScheduledExecutor, getSchema, getThreadFactory, getTransactionIsolation, getUsername, getValidationTimeout, isAllowPoolSuspension, isAutoCommit, isIsolateInternalQueries, isReadOnly, isRegisterMbeans, setAllowPoolSuspension, setAutoCommit, setCatalog, setConnectionInitSql, setConnectionTestQuery, setConnectionTimeout, setDataSource, setDataSourceClassName, setDataSourceJNDI, setDataSourceProperties, setDriverClassName, setExceptionOverrideClassName, setHealthCheckProperties, setIdleTimeout, setInitializationFailTimeout, setIsolateInternalQueries, setJdbcUrl, setKeepaliveTime, setLeakDetectionThreshold, setMaximumPoolSize, setMaxLifetime, setMinimumIdle, setPassword, setPoolName, setReadOnly, setRegisterMbeans, setScheduledExecutor, setSchema, setThreadFactory, setTransactionIsolation, setUsername, setValidationTimeout, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder, getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriterMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
ManagedPooledDataSource
public ManagedPooledDataSource(com.zaxxer.hikari.HikariConfig config, com.codahale.metrics.MetricRegistry metricRegistry)Create a new data source with the given connection pool configuration.- Parameters:
config- the connection pool configurationmetricRegistry- the metric registry used to register the connection pool metrics.
-
ManagedPooledDataSource
public ManagedPooledDataSource(com.zaxxer.hikari.HikariConfig config)
-
-
Method Details
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException- Specified by:
getParentLoggerin interfacejavax.sql.CommonDataSource- Overrides:
getParentLoggerin classcom.zaxxer.hikari.HikariDataSource- Throws:
java.sql.SQLFeatureNotSupportedException
-
start
public void start() throws java.lang.Exception- Specified by:
startin interfaceio.dropwizard.lifecycle.Managed- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.Exception- Specified by:
stopin interfaceio.dropwizard.lifecycle.Managed- Throws:
java.lang.Exception
-