public class JdbiFactory extends Object
Constructor and Description |
---|
JdbiFactory() |
JdbiFactory(com.codahale.metrics.jdbi3.strategies.StatementNameStrategy nameStrategy) |
Modifier and Type | Method and Description |
---|---|
org.jdbi.v3.core.Jdbi |
build(Environment environment,
PooledDataSourceFactory configuration,
ManagedDataSource dataSource,
String name)
Build a fully configured
Jdbi instance managed by the DropWizard lifecycle
with the configured health check; this method should not be overridden
(instead, override newInstance(ManagedDataSource) and
configure(Jdbi) ) |
org.jdbi.v3.core.Jdbi |
build(Environment environment,
PooledDataSourceFactory configuration,
String name)
Build a fully configured
Jdbi instance managed by the DropWizard lifecycle
with the configured health check; this method should not be overridden
(instead, override newInstance(ManagedDataSource) and
configure(Jdbi) ) |
protected com.codahale.metrics.jdbi3.InstrumentedSqlLogger |
buildSQLLogger(com.codahale.metrics.MetricRegistry metricRegistry,
com.codahale.metrics.jdbi3.strategies.StatementNameStrategy nameStrategy)
This creates a default
InstrumentedSqlLogger instance with the specified
MetricRegistry and nameStrategy . |
protected void |
configure(org.jdbi.v3.core.Jdbi jdbi)
Overridable function to allow extra customization of the created
Jdbi
instance. |
protected org.jdbi.v3.core.Jdbi |
newInstance(ManagedDataSource dataSource)
This creates a vanilla
Jdbi instance based on the specified data source;
this can be overridden if required |
public JdbiFactory()
public JdbiFactory(com.codahale.metrics.jdbi3.strategies.StatementNameStrategy nameStrategy)
public org.jdbi.v3.core.Jdbi build(Environment environment, PooledDataSourceFactory configuration, String name)
Jdbi
instance managed by the DropWizard lifecycle
with the configured health check; this method should not be overridden
(instead, override newInstance(ManagedDataSource)
and
configure(Jdbi)
)environment
- configuration
- name
- Jdbi
object using a managed data source
based on the specified environment and configurationbuild(Environment, PooledDataSourceFactory, ManagedDataSource,
String)
public org.jdbi.v3.core.Jdbi build(Environment environment, PooledDataSourceFactory configuration, ManagedDataSource dataSource, String name)
Jdbi
instance managed by the DropWizard lifecycle
with the configured health check; this method should not be overridden
(instead, override newInstance(ManagedDataSource)
and
configure(Jdbi)
)environment
- configuration
- dataSource
- name
- Jdbi
objectprotected com.codahale.metrics.jdbi3.InstrumentedSqlLogger buildSQLLogger(com.codahale.metrics.MetricRegistry metricRegistry, com.codahale.metrics.jdbi3.strategies.StatementNameStrategy nameStrategy)
InstrumentedSqlLogger
instance with the specified
MetricRegistry
and nameStrategy
. This can be overridden if required.metricRegistry
- The MetricRegistry
to send to the InstrumentedSqlLogger
.nameStrategy
- The StatementNameStrategy
to send to the InstrumentedSqlLogger
.InstrumentedSqlLogger
.protected org.jdbi.v3.core.Jdbi newInstance(ManagedDataSource dataSource)
Jdbi
instance based on the specified data source;
this can be overridden if requireddataSource
- protected void configure(org.jdbi.v3.core.Jdbi jdbi)
Jdbi
instance.
If this is overridden it is strongly recommend that
super.configure(jdbi, configuration)
is invoked before any other
changes are made if you intend to use the default as a base so that the
customized settings will supersede the defaults
jdbi
- Copyright © 2011. All rights reserved.